Getting started with the Original API

 

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 StatusDescription
200Operation was completed OK
400Operation failed because something in the request was wrong. Fix the request and try again.
500Some internal error occured. Report this to LeadDesk support and/or try again later.

Common Errors

ErrorDescription
ERR_UNDEFINEDUndefined error.
ERR_ARGUMENT_MISSINGMandatory argument was not included in the request.
ERR_ARGUMENT_INVALIDSubmitted argument is not valid. Integer parameters need to be integers. e.g. ‘A’ is not a valid integer.
ERR_AUTHENTICATIONAuthentication failed. Check the auth parameter.
ERR_INVALID_MODULEInvalid module requested. Check the name of the module.
ERR_INVALID_COMMANDInvalid module command. Check the name of the command.
ERR_DBSome generic error with DB. Please contact customer support!
ERR_DISABLEDService is disabled temporarily. Contact customer support for more information!
ERR_NOT_FOUNDSomething 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_SUPPORTEDFeature, command, parameter etc. is not supported
ERR_ARGUMENT_EMPTYMandatory string argument is empty.
ERR_ARGUMENT_LENGTHLength 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:

NameID
Czech12
Danish17
English1
English (British)16
Estonian3
Finnish4
German7
Hungarian8
Norwegian14
Polish11
Romanian9
Russian15
Slovak13
Spanish10
Swedish5