Rest APIs
A REST API defines a set of functions using which the developers can perform requests and receive responses via the HTTP protocols such as GET and POST.
Server URI
SalesIQ offers the following server URI. Choose the server URI based on your data center.
Data Center | ZohoSalesIQ_Server_URI | ZohoAccounts_Server_URI | Developer Console |
US (United States) | salesiq.zoho.com | accounts.zoho.com | api-console.zoho.com |
EU (Europe) | salesiq.zoho.eu | accounts.zoho.eu | |
IN (India) | salesiq.zoho.in | accounts.zoho.in | |
AU (Australia) | salesiq.zoho.com.au | accounts.zoho.com.au | |
CN (China) | salesiq.zoho.com.cn | accounts.zoho.com.cn | |
JP (Japan) | salesiq.zoho.jp | accounts.zoho.jp |
What is the Screen name?
The unique name provided to your SalesIQ portal is known as the Screen name.
https://salesiq.zoho.com/zylker/index
What is the response format?
The response format is how you get the answer from the respondent. Both the success and the error responses hold the status code as 200.
Success Response Format
If the request is successful, the response object contains a key "data" that holds the result of the request.
- url : request url
- object : list or resource object type
- data : String or array or object
- sync_time : request current time (Only to GET Resouce list APIs)
{
"data" : <value - string, array or object> ,
"url":<value - string> ,
"object": < value - string>
}
Error Response Format:
In case of errors, the response object contains a key "error" which contains information about the error. The error object might contain keys such as the "code" (unique error code), the "message" (description of the error), and also you might get one of these optional keys (json_key or param or header) in your error response. Use them to identify and resolve your error.
{
"error" :
{
"message":"Invalid URL",
"code":1006,
"json_key":<value - string>, // Optional key
"param":<value - string>, // Optional key
"header":<value - string> // Optional key
}
}
Basic Authorization Errors
This type of response occurs in case of internal server error (i.e., due to problems in the server while retrieving the data.)
message: "Unknown authentication error, Contact SalesIQ Team!"
This error occurs when either the Authorization header is absent or is not set properly.
Message: "Invalid authorization header."
This error occurs when the request header value is not valid. (For ex: If an API accepts JSON input, the request header "content-type" should be "application/json")
Message: "Invalid header value"
Header: <header-name>
If your error is related to the "content-type" header you can refer to the following:
Valid content-type request header values:
For JSON input APIs - application/json
For form input APIs - application/x-www-form-urlencoded
The invalid request type error occurs when the request method is incorrect (For ex : If you have sent a Post request instead of a Get URL request.)
Message: "Invalid Request Type."
This type of error occurs when the user portal is invalid (i.e., If the user Portal is not valid or the provided screen name is wrong.)
Message: "Invalid portal or wrong screen name."
This kind of error occurs if the requested URL is incorrect.
For example: https://zylker.com/api/ - is a wrong URL because the screen name is missing in the provided URL.
Message: "Invalid URL"
Error sent when the data type of a parameter sent does not comply with the mentioned one.
Message: Invalid datatypes found in params,
param: <Invalid-param-name>, //Optional key
json_key: <Invalid-json-key> //Optional key
You might get one of these optional keys (json_key or param) in your error response. Use them to identify and resolve your error.
This kind of error occurs if the OAuthToken is incorrect.
Message: Invalid OAuthToken.
This kind of error occurs if the OAuthScope is invalid.
Message: Invalid OAuthScope.
This kind of error occurs if the mentioned method is invalid.
Message: Invalid Method.
This kind of error occurs if the provided param is invalid or not present.
Message: Either the request parameters are invalid or absent,
param: <Invalid-param-name> //Optional key
This kind of error occurs if the provided input stream is invalid or is not present.
Message: Either the inputstream is invalid or absent,
json_key: <Invalid-json-key> //Optional key
General Errors
This type of response occurs in case if the provided resource details already exist.
message: "Resource already exists"
This type of error occurs when the operator doesn't have the access to perform the operation based on their role (Associate, Supervisor, Administrator).
Message: "Operator doesn't have the permission to perform the operation"
This type of error occurs when the resource limit has exceeded. This is based on their current Zoho SalesIQ purchase plan.
Message: "Resource limit reached for current plan"
This type of error occurs when the file sent doesn't contain any data.
Message: "File is empty"
This kind of error occurs if the requested resource is not valid.
Message: "Invalid Resource"
This type of error occurs when the requested operator does not belong to the portal.
Message: Invalid operator
This kind of error occurs if your current plan does not support the requested action.
Message: Operation is not available in the current plan
This kind of error occurs if too many actions are performed at the same time and the IP is blocked from performing any action for a while.
Message: Too many requests, lease try after sometime
This kind of error occurs if the requested operator ID is not valid.
Message: Invalid Operator id/s
This kind of error occurs if the requested department ID is not valid or is not present .
Message: Invalid Department IDs
This kind of error occurs if you are about to delete the last available resource in the portal. (Ex: If your portal has one department and you are about to delete that department, then this error will occur.)
Message: Last available resource
This kind of error occurs if the file size is greater than the allowed size.
Message: File size is greater than the allowed size
This kind of error occurs if the file type is not valid.
Message: Invalid file type
This kind of error occurs if the filter you have applied is not valid.
Message: Invalid Filter
This kind of error occurs if the given data is insufficient to perform the action.
New Key Details
- You will get "json_key" in your error response if your input JSON key is invalid.
{
"department":{
"status":012345
},
"app_ids":["app", 123456789],
"operators":[
{
"name":"agent 1"
},
{
"name":"$#!@%^"
}
]
}
Note:
Scenario | Syntax | Example |
If an invalid value is present inside JSONObject | <parent-key>.<child-key> | department.status |
If an invalid value is present inside JSONArray | <key>[<index>] | app_ids[0] |
If an invalid value is present inside an array of JSONObject | <parent-key>[<index>].<child-key> | operators[1].name |
- You will find "param" key in your error response if your query param or form input is invalid.
- You will find "header" key in your error response if your request header is invalid.