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

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?

Related

Vonage WhatsApp messages suddenly stopped working

I have recently joined a company that is using Vonage and we have WhatsApp communications which was working fine in both dev and production that have both suddenly stopped working.
The shape of the incoming json looks to have changed significantly, but I have changed the code that is reading this and am able to read the messages into the system.
The problem that I have now, is outgoing message is not being accepted.
If I send this json body over
{
"from": "4474183xxxxx",
"to": "4474719xxxxx",
"message": {
"Type": "text",
"content": "Hello! I’m CAI, A Virtual Chat-bot assistant. blurb, more blurb.... .\n\n1. Okay I understand\n\nChoose any one option. Type \"1\" to choose first option."
}
}
I get the following response
{
"Status": "fail", // custom one to my company
"e3": {
"Error": {
"body": {
"type": "https://developer.vonage.com/api-errors",
"title": "Your request parameters didn't validate.",
"detail": "Found errors validating 1 of your submitted parameters.",
"invalid_parameters": [
{
"name": "to",
"reason": "Malformed JSON body."
}
],
"instance": "cf4bce73-2db5-4102-b7af-xxxxxx"
},
"headers": {
"date": "Wed, 02 Nov 2022 14:02:08 GMT",
"content-type": "application/problem+json",
"content-length": "287",
"connection": "close",
"x-envoy-upstream-service-time": "3",
"x-frame-options": "deny",
"x-xss-protection": "1; mode=block",
"strict-transport-security": "max-age=31536000; includeSubdomains",
"x-content-type-options": "nosniff",
"server": "envoy"
},
"statusCode": 400
},
"StatCode": 400,
"Response": null
},
"a": {
"label": 6,
"trys": [
[
0,
6,
null,
7
]
],
"ops": []
}
}
However, looking at the shape of the message that is on the website (https://dashboard.nexmo.com/messages/sandbox) and send this message
{
"from": "xxxx",
"to": "xxxx",
"message_type": "text",
"text": "Hello! I’m CAI, blurb... .\n\n1. Okay I understand\n\nChoose any one option. Type \"1\" to choose first option.",
"channel" : "whatsapp"
}
I get this response
{
"Status": "fail",
"e3": {},
"a": {
"label": 6,
"trys": [
[
0,
6,
null,
7
]
],
"ops": []
},
"Message": "Cannot read property 'Type' of undefined"
}
I would be grateful if someone could help me shape the message that needs to be sent to vonage to that this can be sent out to the end user \ recipient correct.
Thanks
Simon

Sandbox access token not working [Easyship]

We have to try to integrate Easyship courier API. And We are facing the below issue.
{
"rates": [],
"messages": [
"Sorry, we couldn't find any shipping solutions based on the information provided."
]
}
For more information, I have shared the request parameter and API response.
API URL:- https://api.easyship.com/v2/rates
Request Parameter:
{
"origin_address": {
"postal_code": "91601",
"city": "Los Ángeles",
"state": "CA",
"country_alpha2": "US"
},
"destination_address": {
"postal_code": "95140",
"city": "Mount Hamilton",
"state": "CA",
"country_alpha2": "US"
},
"parcels": [
{
"total_actual_weight": 5,
"items": [
{
"quantity": 1,
"category": "mobile_phones",
"dimensions": {
"width": 10,
"height": 10,
"length": 25
},
"description": "Apple iPad",
"actual_weight": 5,
"declared_currency": "USD",
"declared_customs_value": 49500.55
}
]
}
]
}
Response Parameter:
{
"status": "failure",
"errors": [
"Sorry, we couldn't find any shipping solutions based on the information provided."
],
"request_id": "545b5f76a41e2994a13f384559dee625",
"timestamp": "2022-10-12T10:09:21.272Z"
}
Note:
This request parameter works with the production access token.
We have applied all possible solutions for this issue but didn't find anything.
Also we don't want to use the production access token because we are in the developing stage. so please please provide working with a sandbox solution.

Retrieving Custom Question/Responses on Booking/Event

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.

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.

Zoho Inventory API json

When I run a test GET call in postman I get back the following json
"code": 0,
"message": "success",
"packages": [
{
"package_id": "1041677000009727045",
"salesorder_id": "1041677000009727003",
"shipment_id": "",
"customer_id": "1041677000007872931",
"customer_name": "TEST",
"status": "not_shipped",
"package_number": "PKG-00005",
"tracking_number": "",
"is_tracking_enabled": false,
"shipping_charge": 0,
"date": "2019-02-26",
"quantity": 1,
"salesorder_number": "SO-00023",
"created_time": "2019-02-26T16:13:11-0500",
"delivery_method": "",
"last_modified_time": "2019-02-26T16:13:11-0500",
"shipment_date": "",
"is_carrier_shipment": false,
"associated_packages_count": 0
},
],
"page_context": {
"page": 1,
"per_page": 200,
"has_more_page": false,
"report_name": "zom.common.Packages",
"applied_filter": "Status.All",
"custom_fields": [],
"sort_column": "created_time",
"sort_order": "D"
}
}
My issue is that the API request does not show line_items as shown in the documentation (https://www.zoho.com/inventory/api/v1/#Packages).
Does anyone know if the line_items exist but it just can't be seen as a json (e.g. I can update them but postman just cant view them?)
Had a support ticket in with Zoho but they haven't replied.
Try retrieving one package with the postman version of:
curl https://inventory.zoho.com/api/v1/packages/{package_id}
It should display the line_items per this documentation:
https://www.zoho.com/inventory/api/v1/packages/#retrieving-a-package