API Usage
We use XML-RPC with a nil value extension. CET time zone is assumed in datetime fields.
Authentication
You need to authenticate yourself before calling any XML-RPC method. See documentation of client.login() for information about user authentication.
Method responses
Every method responds with a XML-RPC structure in this form:
{
int status
string statusMessage
string session
(addditional data, depending on the actual XML-RPC method)
}
Status code 200 indicates that operation performed sucessfully. Other status codes indicate various kinds of error states. Status code numbering is inspired by HTTP status codes:
- 2xx: Operation was successfull
- 4xx: Client side error (e.g. not found, access forbidden)
- 5xx: Server side error
How the XML-RPC response looks like for status code 200 (or 2xx) is documented in the given XML-RPC method documentation.
Status code 400 means that some parameters are missing, are in wrong type etc. In this case we try to help you figure out which parameters are missing or what is the problem. The XML-RPC method response has the following structure:
{
int status = 400
string statusMessage = "Invalid parameters"
array errors (
string description = e.g. "Parameter campaign.name must be present",
...
)
}
Status code 406 means that the data you provided is not acceptable because of our naming constraints or value ranges. This usually means that the user of your software has entered invalid data, so in response we provide the error id and name of the field where the error occured (if applicable) and possibly other informations. Error id is just a string, but we assume you might want to translate it so we try to make these error ids brief and we will not change them in future (in the current Sklik API major version). The 406 error response looks like this:
{
int status = 406
string statusMessage = "Invalid data in request"
array errors (
struct {
string id = "campaign_name_missing"
string field = "name"
},
struct {
string id = "campaign_dayBudget_is_too_low"
string field = "dayBudget",
int minimum = 1000,
},
...
)
}
Note that there are XML-RPC methods that do only data validation (their name
ends with checkAttributes). They cost less than the data-changing methods,
so it is advantageous to use them. They are also useful in case when you want
to provide the ability to modify multiple entities (campaigns, keywords etc.)
at once; if user enters incorrect data for one entity and you do not want to
some entities update successfully while others not, you can check all of them
before updating to see if the update will succeed.
