Retrieving Custom Question/Responses on Booking/Event - api

Is there any way to get an EXPORT of all Scheduled, Past and Upcoming Events from my Account BUT via a webhook or API? 
Specifically, I want to be able to also get the Responses to questions on these bookings/events. 
I can get the List of events okay using an API HOWEVER this does not pass back the responses to the questions on the event.  Is there any way to do this programmatically?
If I was able to make a call to trigger the EXPORT function as available through the interface of my account, that would be great and meet the requirements of the data I need.
Thank you

The answers to questions are specific to each Invitee, not the whole Event (an Event can have multiple Invitees), so you need to get List of Invitees (in API v2) for a given Event. Each Invitee item will have a questions_and_answers array.
Example request and response:
curl --request GET \
--url https://api.calendly.com/scheduled_events/<UUID>/invitees \
--header 'Authorization: Bearer <access_token>' \
--header 'Content-Type: application/json'
{
"collection": [
{
"cancel_url": "https://calendly.com/cancellations/AAAAAAAAAAAAAAAA",
"created_at": "2020-11-23T17:51:18.327602Z",
"email": "test#example.com",
"event": "https://api.calendly.com/scheduled_events/AAAAAAAAAAAAAAAA",
"name": "John Doe",
"new_invitee": null,
"old_invitee": null,
"questions_and_answers": [
{
"answer": "radio button answer",
"position": 0,
"question": "Question with Radio Buttons answer type"
},
{
"answer": "Multiple line\nAnswer",
"position": 1,
"question": "Question with Multiple Lines answer type"
},
{
"answer": "Answer 1\nAnswer 2\nAnswer 3",
"position": 2,
"question": "Question with Checkboxes answer type"
}
],
"reschedule_url": "https://calendly.com/reschedulings/AAAAAAAAAAAAAAAA",
"rescheduled": false,
"status": "active",
"text_reminder_number": null,
"timezone": "America/New_York",
"tracking": {
"utm_campaign": null,
"utm_source": null,
"utm_medium": null,
"utm_content": null,
"utm_term": null,
"salesforce_uuid": null
},
"updated_at": "2020-11-23T17:51:18.341657Z",
"uri": "https://api.calendly.com/scheduled_events/AAAAAAAAAAAAAAAA/invitees/AAAAAAAAAAAAAAAA",
"canceled": false,
"payment": {
"external_id": "ch_AAAAAAAAAAAAAAAAAAAAAAAA",
"provider": "stripe",
"amount": 1234.56,
"currency": "USD",
"terms": "sample terms of payment (up to 1,024 characters)",
"successful": true
}
}
],
"pagination": {
"count": 1,
"next_page": "https://calendly.com/scheduled_events/AAAAAAAAAAAAAAAA/invitees?count=1&page_token=sNjq4TvMDfUHEl7zHRR0k0E1PCEJWvdi"
}
}
Note: if you have an Event URI from a previous API response (e.g. https://api.calendly.com/scheduled_events/846428db-f54e-4196-8075-4204673aac7a), just append /invitees to it to get a list of all Invitees. You don't have to build the whole URL from scratch.

Related

How to get exact index match of list of objects using curl command?

Here I'm using curl command to call api for fetch exact index match of list of objects like [{},{}]
This is the result of Api Json data
{
"results": [
{
"description": "ncc",
"id": "9cac6ca5-29e2-4062-9326-5f443a5bdc8a",
"artifactId": "e65262ea-68a3-41f3-82b9-18844139c9b7",
"artifactType": "packages",
"displayTypeName": "Workflow Package",
"operationId": "execute_workflow",
"input": [
{
"name": "vnfName",
"value": "NCC",
"group": "default"
},
{
"name": "healthAdditionalParams",
"value": {},
"group": "default"
},
{
"name": "healingAdditionalParams",
"value": {},
"group": "default"
}
],
"additionalParameters": [],
"targetResourceId": "4659b03b-760c-4891-8fda-80305e61468a",
"output": [],
"state": "EXECUTING",
"externalId": null,
"jobId": 493,
"workflowExecutionId": "8afb4eab-4e93-4d67-99fa-face2abb72a8",
"realm": "ncom",
"lastModifiedTime": 1642587522000,
"creationTime": 1642587522000,
"lastModifiedUser": "adminuser",
"deletedAt": null,
"batchOperationsMetadataId": "084cae73-ffa1-4da6-bc92-21ab62a00349",
"scheduleId": null
}]}
I used the below curl command to read these data
curl --location --request -v -k -X GET 'http://localhost/api/v1/aes/?query=state:eq:EXECUTING&query=input[0].value:eq:NCC'\
--header 'Content-Type:application/json'\
--header 'Accept:application/json'\
--header 'Authorization:Bearer eyJhb...'\
When I call above curl command I facing issue so anyone help me to find exact match of input[0].value:eq:'NCC'

ASPNET Core 3.x - Appending data to all API responses

I've been googling for past 3 hours and I couldn't find anything helpful.
I'm trying to transform all my requests to a specific RESTful standard.
Right now, each and every controller returns data in this format:
[
{
"id": 3,
"title": "Test",
"content": "Content Test",
"userId": 1,
"user": null,
"categoryId": null,
"category": null,
"comments": null,
"tags": null,
"createdOn": null,
"updatedOn": null
}
]
What I want is to wrap all of these responses in a container, that also consists of metadata - as seen below:
{
"statusCode": 200,
"statusMessage": "success",
"meta":
{
"count": 1,
"total": 1,
"pagination":
{
"page": 1,
"pages": 1,
"limit": 20
},
"filters": [],
"sorters": []
},
"data":
{
[
{
"id": 3,
"title": "Test",
"content": "Content Test",
"userId": 1,
"user": null,
"categoryId": null,
"category": null,
"comments": null,
"tags": null,
"createdOn": null,
"updatedOn": null
}
]
}
}
Is the proper approach to just make a class called ResponseContainer and make all controllers return it? Because I feel like that's a viable solution.
In one of my projects, I used a generic class as response, such as MyApiResponse<T>. This class contains properties for meta data like the HttpStatusCode of the response, error messages, etc. They are set upon each response.
Within this class, I have a List<T> called Data.
Each API method returns MyApiResponse<T> where T is being the concrete data class. For instance, it could be MyApiResponse<Weather> where Data would store a List<Weather.
I'll definetly use this approach for my next API project as well.

BigCommerce customer attributes from client/store

Can I retrieve the customer's
There is a current-customer API - https://developer.bigcommerce.com/api-docs/customers/current-customer-api, but it only returns the following bits about a customer.
"customer": {
"id": 4927,
"email": "john.doe#gmail.com",
"group_id": "6"
}
I'd really to have the ability to get all the data from
https://developer.bigcommerce.com/api-reference/customer-subscribers/v3-customers-api/customer-attributes/customersattributesget as a property of the payload for current-customer-api
/customer/current.jwt?app_client_id={appClientId}&attribute-ids:in=1,2,3
"customer": {
"id": 4927,
"email": "john.doe#gmail.com",
"group_id": "6"
"attributes": [
{
"id": 1,
"name": "Age",
"type": "string",
"date_created": "2018-11-13T21:42:06Z",
"date_modified": "2018-11-14T16:46:23Z"
},
{
"id": 2,
"name": "Shoe Size",
"type": "number",
"date_created": "2018-11-14T16:34:57Z",
"date_modified": "2018-11-14T16:34:57Z"
},
{
"id": 3,
"name": "Date Joined",
"type": "date",
"date_created": "2019-02-19T19:13:21Z",
"date_modified": "2019-02-19T19:13:21Z"
}
]
}
This is an interesting feature request. The purpose of the current customer API is to verify the identity of a logged in customer in a secure way, which is why the payload is so minimal (with the understanding that you would likely be making a request for the full customer record based on the id returned).
We are planning to surface customer attribute data on the storefront though, which sounds like it would solve for your use case. We'll be adding Handlebars support soon, and we've got a storefront GraphQL API in the works as well. You can read more in our blog post here:
https://medium.com/bigcommerce-developer-blog/customize-and-extend-your-customer-data-with-the-new-bigcommerce-v3-customers-api-8609903e102a

Why does /4.0/events/ return NotFoundError in the SocialTables API?

I create several new events in my account. But when I call this endpoint - https://api.socialtables.com/4.0/events/ - I always receive a 404 response with this body:
{
"code": "NotFoundError",
"message": ""
}
If I call the legacy endpoint - https://api.socialtables.com/4.0/legacyvm3/teams/[TEAM-ID]/events - it returns both the legacy events and the new events. But it only tells me the legacy ID values. I guess that's okay, but it's confusing. It looks like I am unable to use the v4 API at all.
Follow-up from this question: Why am I getting 401 UnauthorizedError when getting a list of events using the SocialTables API?
I see it now. Don't use a trailing slash when requesting the /events route:
https://api.socialtables.com/4.0/events
Hmmm not exactly sure where the disconnect is. I just ran that endpoint with your most recent oauth token and got the following result:
[
{
"permissions": [
"CHANGE_OWNER",
"ADD_PLANNER",
"REMOVE_PLANNER",
"ADD_VIEWER",
"REMOVE_VIEWER",
"ADD_CHECKIN",
"REMOVE_CHECKIN",
"UPDATE_EVENT",
"DELETE_EVENT",
"UPDATE_GUEST",
"DELETE_GUEST",
"CREATE_GUEST",
"CHECKIN_GUEST",
"CAN_VIEW"
],
"data": {
"id": "19fdb5e0-1874-11e7-a3a0-65cadad84d84",
"name": "Test Event 5",
"type": "Athletic Event",
"description": null,
"start_epoch": 1492660800000,
"end_epoch": 1492660800000,
"archived": 0,
"deleted": 0,
"status": "ACTIVE",
"has_time": 1,
"timezone": null,
"legacy_id": 1962925,
"industry": "Corporate",
"role": "owner"
}
},
{
"permissions": [
"CHANGE_OWNER",
"ADD_PLANNER",
"REMOVE_PLANNER",
"ADD_VIEWER",
"REMOVE_VIEWER",
"ADD_CHECKIN",
"REMOVE_CHECKIN",
"UPDATE_EVENT",
"DELETE_EVENT",
"UPDATE_GUEST",
"DELETE_GUEST",
"CREATE_GUEST",
"CHECKIN_GUEST",
"CAN_VIEW"
],
"data": {
"id": "e77c8e50-1703-11e7-a3a0-65cadad84d84",
"name": "test event v4",
"type": "Ceremony",
"description": null,
"start_epoch": null,
"end_epoch": null,
"archived": 0,
"deleted": 0,
"status": "ACTIVE",
"has_time": 0,
"timezone": null,
"legacy_id": 1962858,
"industry": "Education",
"role": "owner"
}
}
]
Here's a curl of what I did minus your real token.
curl --request GET \
--url https://api.socialtables.com/4.0/events \
--header 'authorization: Bearer XXXXXXXXXXXXXXXXXXXXXX7063f'
How are you retrieving your token?

How can I know when a flag is accepted or denied?

I'm playing with the Foursquare API and I was wondering if there are any way to know when a flag is accepted or denied.
The documentation doesn't says anything about what is the content of the response when I flag a venue. The Response fields is empty..
When flagging, the response look like that:
{
"meta": {...},
"notifications": [...],
"response": {
"id": "4b82fd8ef964a52049f130e3",
"name": "times square",
"contact": {},
"location": {
"lat": 43.642197,
"lng": 6.979622,
"cc": "FR",
"city": "New york",
"state": "New york",
"country": "France"
},
"canonicalUrl": "https://foursquare.com/v/times-square-new-york/4b82fd8ef964a52049f130e3",
"canonicalPath": "/v/times-square-new-york/4b82fd8ef964a52049f130e3",
"categories": [],
"verified": false,
"stats": {...},
"creator": {...},
"flags": {
"count": 1,
"items": [
{
"id": "5272152d11d25a4be68777a1",
"type": "remove",
"comments": [],
"reporters": [
{...}
],
"resolvedTime": "Thu Oct 31 09:20:17 UTC 2013",
"resolvedUsers": [],
"value": {
"reason": "doesnt_exist"
}
}
]
}
}
}
Do I need to re-call the same query (as when I'm flagging a venue) and the response will content something to tell the flag is either accepted or denied? Like in resolvedUsers?
Update:
It seems that I can call this url to get a list of all flag for a given venue. Then I can check if my flag id is present, otherwise it means the flag has been handled. BUT I don't know it the flag was accepted or denied...
https://api.foursquare.com/v2/venues/4b23dd27f964a5207c5b24e3/flags?v=20120321&locale=en
And by the way, /flags return the new venue in case of duplicate is accepted, not the duplicate. Makes it harder to determine ..
The flag will go through and be put into the queues for our superusers to moderate, there's no "accepting" or "denying" of a flag—the request of the flag may eventually get accepted or denied though. There's no way to see if a particular flag was accepted or denied through the API, but you'll know if it was accepted if the venue eventually gets changed.