Using an API with Zapier but getting "The app returned ""rest_data" param is incorrect. JSON data expected"." - zapier

So i grab data from an Airtable and then have a custom PUT as the second action using Samba Lives API, specifically Sessions -> PUT Session https://documenter.getpostman.com/view/2014682/samba-live-rest-api/6YzutHM#c87c1db7-2b5c-9b2b-7d63-6b531793cfe2
This is the data in the custom PUT:
Method: PUT
URL: https://samba.live/api/2/ourusername/session
Data Pass-Through? No
Data:
input_type=json&rest_data={
"topic": "Crazy Topic",
"duration": 30,
"start_time": "2025-09-10 12:00:00",
"invited_participants":[
{
"email":"flast#company.com",
"first_name":"First",
"last_name":"Last",
"role":2,
"send_email_invitation":true
},
{
"email": "first.last#gmail.com",
"first_name": "First",
"last_name": "Last",
"role": 1,
"send_email_invitation": true
}
],
}
Unflatten- yes
Basic Auth- ourusername|ourpassword
Headers- none
But the test fails and says "App returned "rest_data" param is incorrect. JSON is expected."
I'm not really sure what to try and Zapier just said we don't help with that. Only thing i could think to try was to delete the input_type section, and that returned with an error saying "Topic is required." Same thing when i left most of it and just deleted the rest_data part.
Any ideas?

Fixed - apparently the comma after the ] threw everything off.

Related

MS Team[BETA] API for Message object property type for reaction

I am trying to create the schema for Message API
As per the documentation, the sample response properties for reaction provided are below
Documentation sample response
"reactions": [
{
"reactionType": "like",
"createdDateTime": "2019-01-21T19:55:51.893Z",
"user": {
"application": null,
"device": null,
"conversation": null,
"user": {
"id": "e1ecb745-c10f-40af-a9d4-cab946c80ac7",
"displayName": null,
"userIdentityType": "aadUser"
}
}
}
]
From the documentation user is Identity type identity set
Identity is of type:
{
"displayName": "string",
"id": "string",
"tenantId": "string",
"thumbnails": { "#odata.type": "microsoft.graph.thumbnailSet" }
}
From the sample response as well as the response from endpoint, tenantId is not present.
There is a difference in sample response/actual endpoint response and documented properties:
The one with tenantId or one without tenantId.
The user is 1 level as per property documentation but as per actual response and sample response user property has user with in.
What is the correct schema of reaction property that we should consider, because we see variation in documentation vs actual response ?
ok, I think I understand - you're just asking what you should be coding for / expecting, when you query the api. It looks to me like the first link you've posted is the more correct, but you can verify this by using the Graph Explorer. This response does NOT bring back "tenantId", but you haven't explained if you -need- tenantId. If so, there are other ways to get it.
#KritikaVohra, Consider the response that you receive from the https://graph.microsoft.com/beta/teams/{id}/channels/{id}/messages. You don't need tenant id here. in case in conversation if you need it, you can use it from turnContext.

Extracting specific values from a dictionary in iOS Shortcuts to display in a Choose from List menu?

I have a REST endpoint that returns a body that looks like this:
"posts": [
{
"message": "This is another message",
"created": "2019-12-27 21:33:54+10",
"items": [...],
"tags": [...],
"toot_id": "12345"
},
{
"message": "This is a message",
"created": "2019-12-26 20:42:15+10",
"items": [...],
"tags": [...],
"toot_id": "12344"
}
]
I want to extract just the message and toot_id fields and use a "Choose from List" action to display the message text, and upon selection pass the corresponding toot_id of the chosen message to the next action. Unfortunately I'm greatly struggling with how to do this... I know Javascript and TypeScript and can handle this sort of thing in those languages with no problems, but iOS's Shortcuts app is thwarting me. I've got as far as a "Repeat with each item" with the posts key as a result of hitting my REST endpoint, but I'm stuck as to how to continue from there, and I'm not clear on whether I should be setting the various actions inside the loop to "as Text" or "as Dictionary" either.
Thanks!
This is a screenshot of how I got it to work in a similar situation.
The key for me was the combination of "Get dictionary from Input" (use the variable), "Set Dictionary Value", and then "Set Variable". Trying to do "Set Dictionary Value" on the variable directly (in one step) never worked.

How to get text response in survey monkey via API

I'm currently getting responses from SurveyMonkey using the v3 APIs...
I'm using the /collectors/{id}/responses/{id}/details call and I successfully getting the resp. BUT the resp has got the IDs and not the text values e.g.
{
"id": "111788228",
"answers": [
{
"choice_id": "828117913"
}
]
}
1) Can I get SM to send me the text answer?
2) If I can't how can I get the text value using the choice_id.
Thanks in advance.
There isn't a way currently to get the Survey text directly with the responses. You'll have to fetch the survey details or the details for a specific question and match the choice ID with the text for that choice on your own.
GET /v3/surveys/<survey_id>
or
GET /v3/surveys/<survey_id>/pages/<page_id>/questions/<question_id>
You'll get a body back with the choices like this:
{
...
"answers": {
"choices": [{
"id": "12345",
"visible": true,
"is_na": false,
"text": "Apples",
"position": 1
}, ...]
},
...
}
Then you can just match the id field with the choice_id field from the response.
Now there is 'bulk' API.
Look at the 'simple' option:
GET /surveys/{id}/responses/bulk?simple=true

rest/api/2/issue/<issue-id>/transitions returns empty array

I've created an issue that follows this workflow:
When I call rest/api/2/issue/<issue-id>/transitions after creating an issue (which is in OPEN status now) it returns the following JSON:
{
"expand": "transitions",
"transitions": [
{
"id": "4",
"name": "Start Progress",
"to": {
"self": "URL",
"description": "This issue is being actively worked on at the moment by the assignee.",
"iconUrl": "URL",
"name": "In Progress",
"id": "3",
"statusCategory": {
"self": "URL",
"id": 4,
"key": "indeterminate",
"colorName": "yellow",
"name": "In Progress"
}
},
"fields": {}
}
]
}
When I make the same call after I change the issue status to "IN PROGRESS" I get back
{
"expand": "transitions",
"transitions": []
}
My questions are:
In the first response shown above, I expected the transitions to "CLOSED" and "RESOLVED" along with the one to "IN PROGRESS". But I only get back the one leading to "IN PROGRESS". Why?
I expected the second response to contain the transitions to "CLOSED", "RESOLVED" and "OPEN", but it returns an empty array. Why?
Please explain the responses from this API
What call should I make to get the next possible transitions?
This is probably a permission issue. The API only shows the transitions that are available to the current user, thus if you are not allowed to execute the CLOSE or RESOLVE transitions due to conditions in the project workflow, they will not appear in the JSON object.
See getTransitions from the JIRA REST API :
Get a list of the transitions possible for this issue by the current user, along with fields that are required and their types.
In order to get the transitions, you can either log in with an account that has the required permissions (check the corresponding workflow) or modify the conditions of the transition in this workflow.

"additional properties" error in Survey Monkey API call

I'm trying to use the create_flow endpoint to the Survey Monkey API. It is sending back a status 3 message with the following error:
additional properties not defined by 'properties' are not allowed in field '_data'
I'm able to do successfully use all other API endpoints and have a valid API key and durable OAuth token.
Here's an example JSON body that I'm sending to: https://api.surveymonkey.net/v2/batch/create_flow?api_key=apikeyhere
{
"survey": {
"template_id": "566",
"survey_title": "test1",
"collector": {
"type": "email",
"name": "collector1",
"recipients": [
{
"email": "email#example.com"
}
]
},
"email_message": {
"reply_email": "myemail#example.com",
"subject": "this is a test"
}
}
Note: JSON formatting here is being generated automatically using RJSONIO
Any ideas what might be causing the error? It seems like all fields are correctly named and where they're supposed to be, so I'm not sure what the problem is.
It's a bad error message unfortunately - it's a known issue. It means you are providing extra keys that are not part of the create_flow schema.
The issue here is that the "email_message" and "collector" keys have been nested inside of "survey", instead of being in the main JSON body like the "survey" key. Move them out a level and it should work.

Resources