Features of API version 2.0

OAuth 2.0

The v2 APIs use the OAuth2.0 protocol for authentication. They use the Authorization Code Grant Type to obtain an access token. This grant type allows you to share specific data with any application while keeping your usernames and passwords private.

This protocol also lets you use selected scopes to control the type of resource that a client application can access. Refer OAuth 2.0 for v2 APIs-An Overview, for more information.

REST APIs

All v2 APIs follow REST standards, i.e, they use the HTTP request methods GET, POST, PUT, DELETE, etc.

  • GET - Fetch the records

  • POST - Insert new records

  • PUT - Update the existing records

  • DELETE - Delete the records

All inputs and responses are in JSON format.

All responses will have an HTTP Status Code.

JSON Only

All v2 API inputs and responses are only in the JSON format, whereas the v1 APIs supported both XML and JSON.

Some of the advantages of using JSON are:

  • Less verbose: JSON does not have tags like XML and hence, requires fewer characters to represent data.

  • Faster: Since JSON uses less data, it is easy to read, and parse data thus increases the parsing speed.

  • Readable: JSON is data that is very straightforward and easy to read.

Note:
The default domain for the Workerly account is the US

Endpoint Changes

v2 APIs have the endpoint http://workerly.zoho.com/workerly/v2 where
http://workerly.zoho.com is the domain name and
/workerly/v2/ is the endpoint for the Workerly v2 APIs

For instance, the request URL to get the list of Temps in Workerly is
http://workerly.zoho.com/workerly/v2/temps

Note:

When you generate the grant token(authorization code) on the browser, the resulting URL is
{redirect_uri}?code={grant_token}&location=us&accounts-server=https%3A%2F%2Faccounts.zoho.com
The "location=us" parameter contains the domain of your account. Use this domain in all API endpoints.
For instance, the URL to fetch all Workerly Temps in

  • EU domain: "https://workerly.zoho.eu/workerly/v2/Temps"

  • IN domain: "https://workerly.zoho.in/workerly/v2/Temps"

  • AU domain: "https://workerly.zoho.com.au/workerly/v2/Temps"

API Names

Zoho Workerly v2 APIs use API names generated internally while creating a custom module, field, or related list label. The system uses this key "api_name" in the JSON data while accessing the Workerly APIs. This ensures that the label name changes in custom modules or fields won't affect your existing integrations.

For instance, Temps for the temps module, Currency for the currency field, and Notes for the notes-related list.

Pagination

All v2 API GET responses have the following "info" JSON object.

"info": {
"per_page": 200,
"count": 1,
"page": 1,
"more_records": false
}

  • "per_page": Use this parameter to set the number of records you want to fetch per page. The default value is 200.

  • "page": Use this parameter to fetch the records on that page. The default value is 1.

  • "more_records": This parameter indicates if there are more records in that module. Values are true or false.

Date/Time Format

The v2 APIs follow the ISO 8601 date-time format that includes the time zone:
v2: 2018-03-28T10:32:45+05:30