Here’s a quick example on how to find a Contact by its email address: $endpoint = '' The documentation for the REST API is well written, all in one page and includes examples so I won’t be rewriting everything, check it out here.Ĭontacts and Leads are explained in the Records API section, you simply type Contacts or Leads in the URL. Now we make a similar request to Zoho’s token endpoint:īut replacing grant_type with refresh_token and removing redirect_uri in the Body: Key This will give us the Refresh Token in a JSON response, it never expires so once you get here, congrats! Access Token You have 10 minutes to make the request or else generate a new one. ![]() XxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxĬhange all the above fields with your details except for the grant_type.Ĭode is the Self client code you got before, the one that expires. The request must include the following Header: KeyĪnd a Body ( x-www-form-urlencoded) with: Keyġ000.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx I used Postman for this since it’s a one time request and it made no sense to implement this step into my code. Now we need to make a POST request to this URL (choose one depending on your location): This will give us the Self client token which expires in 10 minutes so let’s be quick. Otherwise it may fail with silent errors and blank pages and you’ll spend some time pulling your hair.įor Expiry choose 10 minutes so we have enough time. You can see the full list of scopes here, if you change them, remember to separate scopes with a comma and no spaces and include the at the beginning. Then click on the three dots at the end and choose “ Self client“. Read the entirety of this part before doing anything, one of the tokens given here will expire in 10 minutes and you will need to start again.ĭepending on where your data is hosted, you will need to access one of these URLs:Ĭlick on “ Add Client ID” and grab the Client ID and the Client Secret, save it somewhere. ![]() Access Token: Used to make requests to the API, expires after 1 hour and you can get a new one with the Refresh Token.Refresh Token: Never expires, used to request an Access Token. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |