Authentication

Basic authentication

For all your calls to the API, you need to give a basic authentication via the basicAuth header.
You will need an API key, a user login and password. To get these, you'll need to enroll in our technical partner program.

In short you'll have to add an HTTP header : "Authorization" which value is "Basic <here the base64 encoded string of apikey;user_login:user_password>.
See here for more info on basicAuth.


Connection with token

If you do not want to keep the user's password for authentication, you may want to connect to the API in order to get and use a connection token.
The token lasts 72h and can be used instead of the password within basic authentication for all your calls.

In order to do so, you need call this specific URL: https://<SERVER_NAME>/apiv1/webapi.do
with the following parameters:
format=json&json_header={"action":"connect"}
and the basic authentication header.

In the result you will get this data:


Here is an example of a successfull result:


			{  
				"ApiReturn":{  
				   "code":"OK",
				   "token":"1234582767907-22dedc40c0c00000-72",
				   "data":{  
					  "User":{  
						 "id":"200",
						 [...]
						 "group":{  
							"id":"123",
							"salesDescr":"Test group"
							[...]
						 }
					  }
				   },
				   "sessionId":"12345678E790DB7CC82FA34421EA023C"
				}
			 }
			

Here is an example of an error result:


			{  
				"ApiReturn":{  
				   "code":"ERROR",
				   "message":"AdelyaProcessException: (Code 3001) apikey is empty in the given API message",
				   "errorCode":"3001",
				   "errorMessage":"Invalid APIKEY: null or empty"
				}
			 }