Invoking the API - please help

Configured everything as described in this article https://help.appsheet.com/en/articles/1979979-invoking-the-api
In Audit Log Details shows information:site-raketa - AppSheet - Google Chrome 2019-12-24
Please help.

@raketa
How was your payload?

what is it about?

@raketa
I’m asking about yout HTTP Body content for the API call.

{
“Action”: “Add”,
“Rows”: [
{
“post_id”: “<<[post_id]>>”,
“post_title”: “<<[post_title]>>”
}
]
}

@raketa
Your HTTP Body is malformed

{
	"Action": "Add",
	"Properties": {
		"Locale": "en-US",
		"Location": "47.623098, -122.330184",
		"Timezone": "Pacific Standard Time"
	},
	"Rows": [
		{
			"post_id": "<<[post_id]>>",
			"post_title": "<<[post_title]>>"
		}
	]
}
1 Like

again
image

You shall check your API endpoint and HTTP headers as well. Status Code indicates that one of these is malformed or there are missing params

what is the endpoint API
and HTTP headers?
my settings


Here the inquiry remained unanswered, please help.

@raketa
As you may realize well, majority of the world and the people are in Christmas Holiday, so you shall understand some delays.
I have before replied you already and mentioned above that your payload is malformed. I have asked you what API endpoint are you using and what is your HTTP header and you had responded with a couple of screenshots which does not give any positive reply as well. I repeat my questions and additionally:
1.) What is the use of the body template here? And what’s its content?


2.) From the additional 2 images I haven’t understood what you are trying to show. Are you trying to invoke AppSheet API thru a 3rd party webhook service like WordPress?

1 Like
  1. This body template:
    {
    “Action”: “Add”,
    “Properties”: {
    “Locale”: “en-US”,
    “Location”: “47.623098, -122.330184”,
    “Timezone”: “Pacific Standard Time”
    },
    “Rows”: [
    {
    “post_id”: “<<[post_id]>>”,
    “post_title”: “<<[post_title]>>”
    }
    ]
    }
  2. Yes, invoke AppSheet API thru a 3rd party webhook service WordPress.

I understand everyone celebrates Christmas, with which I want to congratulate you, but the problem is more important).

Yes I do understand @raketa, however do apologize but nothing is more important than the family especially with the special times.


From this image that you have posted, it can be seen that [post_title] parameter is a sub-key value of an array called {post} and you are trying to retrieve a child parameter of a parent parameter with directly specifying the child parameter in your JSON payload. In normal conditions, you should be able to retrieve the value via [post].[post_title] but I have no any information about the 3rd party service that you are using.


You can alter your Rows parameter of your payload like this:

“Rows”: [
	{
	“post_id”: “<<[post_id]>>”,
	“post”: {
		“post_title”: “<<[post_title]>>”
		}
	}
]
1 Like

Thank you for your patience and willingness to help out other fellow Appsheet users Levent.
This is much much appreciated days in and days out from the Appsheet team here and everywhere else you contribute.
Hi Raketa, I hope you appreciate Levent’s willingness to help you out with your API call issue. He is not an Appsheet employee but another fellow Appsheet users (albeit extremely knowledgeable expert one) who is trying to help you out.
You are more than welcomed to send mail to Support@Appsheet.com if you need further support from the Appsheet team though I think Levent has already given you a path to success above.
Thierry

2 Likes

Your application contains a workflow rule called “Добавленные страницы-1 2” that invokes a webhook action called “add_page_wp” which invokes the REST API. I searched Audit History for the past 2 days and I see no sign that this workflow rule has been invoked. I assume that this workflow rule plays no part in the error you are reporting.

Based on your response to Levent, it appears you are attempting to invoke the AppSheet REST API from WordPress. I looked at the most recent attempt to invoke the REST API in the Audit History. The record with UTC timestamp 12/26/2019 5:34:10 PM reported that the “Action” parameter was missing. In fact, the Action, the other REST API parameter values, and the row data all seemed to be missing from the REST API Body.

You have posted a screen shot that starts with the heading “Sent values:”. Can you explain what that is?

If you want to invoke the REST API from a third party application like WordPress, that system must provide a way to construct a POST body that matches the format expected by the AppSheet REST API. Does WordPress provide that? If so, does it allow you to see the exact format of the POST Body it is sending. It appears that the Body being sent to AppSheet does not conform to the expected Body format.

1 Like

I understand you, maybe this will help?
I use this plugin for WP, but have not used this functionality yet. https://ironikus.com/docs/knowledge-base/data-mapping/
Here is a more detailed screenshot:

I looked at the WP Webhook documentation briefly. Frankly I found it confusing so I am not sure I can provide much guidance.

It does appear that WP Webhook Pro is capable of invoking a Zapier trigger. If so, you should be able to use such a trigger to invoke the AppSheet REST API in your Zap. In your Zap, you could map data that comes in via the WP Webhook Pro trigger into the appropriate fields in the AppSheet REST API call.

1 Like