Getting started with the Original API
LeadDesk Web API enables clients to manage their own LeadDesk data with simple HTTP/HTTPS requests.
Common parameters
All parameters can usually be sent in either POST or GET style. Some commands require that the command specific data is to be send in JSON format in the HTTP request body. In that case the common parameters needs to be sent as GET parameters. These are the common parameters which are required for each request (GET or POST):
- auth
- Identification code provided by the LeadDesk customer support. 32 characters long constant string.
- mod
- Name of the module that should handle the request.
- cmd
- Command that the module should execute.
Basic example (which does not work because authentication value is not correct) http://api.leaddesk.com?auth=11111222223333344444555556666677&mod=contact&cmd=add Used character set is generally UTF-8 unless stated otherwise for each command.
Error handling
If an error occurs during the processing of the command then HTTP response with status 400 or 500 is returned. Error response also includes a short logical text describing the error. Below is a list of common errors that might occur with any request. It is possible for the error message to have additional information after the error code. In that case the format is as follows “[ERROR_TEXT]:[additional info]” for example “ERR_NOT_FOUND:agent”. HTTP Status codes
HTTP Status | Description |
---|---|
200 | Operation was completed OK |
400 | Operation failed because something in the request was wrong. Fix the request and try again. |
500 | Some internal error occured. Report this to LeadDesk support and/or try again later. |
Common errors:
Error | Description |
---|---|
ERR_UNDEFINED | Undefined error. |
ERR_ARGUMENT_MISSING | Mandatory argument was not included in the request. |
ERR_ARGUMENT_INVALID | Submitted argument is not valid. Integer parameters need to be integers. e.g. ‘A’ is not a valid integer. |
ERR_AUTHENTICATION | Authentication failed. Check the auth parameter. |
ERR_INVALID_MODULE | Invalid module requested. Check the name of the module. |
ERR_INVALID_COMMAND | Invalid module command. Check the name of the command. |
ERR_DB | Some generic error with DB. Please contact customer support! |
ERR_DISABLED | Service is disabled temporarily. Contact customer support for more information! |
ERR_NOT_FOUND | Something that was requested could not be found. Usually includes additional information describing what was not found. |
ERR_FILE_TOO_LARGE | When uploading a file by POST file and the file size exceeds the limit. |
ERR_NOT_SUPPORTED | Feature, command, parameter etc. is not supported |
ERR_ARGUMENT_EMPTY | Mandatory string argument is empty. |
ERR_ARGUMENT_LENGTH | Length of mandatory string argument does not meet minimum or maximum length requirements. |
LeadDesk language constants
Language ID for supported general languages. If you want to use client specific language please contact customer support. Common languages:
Name | ID |
---|---|
Czech | 12 |
Danish | 17 |
English | 1 |
English (British) | 16 |
Estonian | 3 |
Finnish | 4 |
German | 7 |
Hungarian | 8 |
Norwegian | 14 |
Polish | 11 |
Romanian | 9 |
Russian | 15 |
Slovak | 13 |
Spanish | 10 |
Swedish | 5 |