Search code examples
oauth-2.0zapier

Zapier oauth v2 access token endpoints


I'm trying to integrate my api in zapier.

To configure OAuth v2 we need to set the endpoints for the Access Token Request as describe here : https://platform.zapier.com/docs/oauth#add-access-token-request-and-refresh-token-request-urls

the probleme is my api server don't even read data in the body when they are sended as json ({"redirect_uri":"xxxx", "client_id":"xxxx", ...}). It only accept data as form parameters (redirect_uri=xxxx&client_id=xxxx&...)

I didn't find any solution to make zapier send data as form parameters even when I use the code mode and z.request().

Thanks for help

edit :

Small precision : The serveur runs on php, parameters are expected to be in $_POST. So i can't send data in $_GET (url parameters) neither php://input (for json)


Solution

  • Depending on their setup, you should able to do that in Visual Builder by adding the redirect URI, client ID, etc, to the URL Params section instead of the Request Body section:

    enter image description here

    For a CLI app, You would want to add those to a params object within the request, instead of a body or headers object. same with triggers or actions. hope that helps!