In today business crm market ZOHO CRM has very good hold. They provide easy to adopt interface for users, So data its quite manageable. Zoho has official API to get data outside from accounts and use it for third party integration.
Zoho provide multiple services like CRM, Zoho Books, Zoho Creator, Subscription etc. You can fetch any account data using its API. To get ZOHO API access, first you need to get Authentication Token.
Steps to Access Zoho APIs
After login in zoho account go to in Customization tab, than choose Extensions & APIs section. Under this APIs tab is showing, you can found here Generate Authentication Token method.
Thier is direct way to create auth token in your browser. After logged in zoho accounts, just use this link for that:
*Note – You must enter the scope of API while generating auth token. In above link we have created token for ZOHO Subscription account. For Example if you are going to use ZOHO crm api than use scope value “ZohoCRM/crmapi“.
After execute this url in browser, you can get success Auth Token value. Which you can use in API call request to Fetch or Insert the data.
Fetch Zoho Subscription Data Using API call:
In this example we will show you Zoho Subscription api call to fetch data. Use below PHP code for that.
$headers = array(
'Authorization: Zoho-authtoken 0310fa**************854897', // use your auth toke here
'X-com-zoho-subscriptions-organizationid: 7678***68' // use your organization id here
$zohocurl = curl_init('https://subscriptions.zoho.com/api/v1/subscriptions');
curl_setopt($zohocurl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($zohocurl, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt( $zohocurl, CURLOPT_RETURNTRANSFER, 1 );
$result = curl_exec($zohocurl);
$sub_data = json_decode($result);
In above PHP example Zoho Subscription Api request is send to fetch all subscription data. You can use this sample code to fetch other kind of zoho data as you require.