Getting started with OT API

Send GET/POST request to http://otapi.net/service/ to get response from api in xml format.

Send GET/POST request to http://otapi.net/service-json/ to get response from api in json format.

Also available secure protocol: https://otapi.net/service/ or https://otapi.net/service-json/
Earlier it was available on separate port https://otapi.net:10443, but now on standard ports only.

Add method name and parameters in GET/POST form to the address depending on query and its size. Some parameters may nootherwiset fit in GET query, so it is always easier to make POST.

The ErrorCode node necessarily comes in the response from api, if it is not equal to Ok and not equal to BatchError - it is necessary to process the error. Errors must be separated by value in the ErrorCode and / or SubErrorCode nodes.

Some ErrorCode that can be processed globally at the website or the application level:

  • SessionExpired - buyer's or administrator's session has expired, it's necessary to offer user log in and repeat his actions.
  • AccessDenied - access to this method is forbidden for this user.
  • InstanceKeyBan - application key is blocked, contact managers in your skype chat for details. It's advisable to show "Technical work is done on the site" for application user.

In some cases, the error message must be shown to the user. It is stored in the Errordescription node and comes with the translation for the language specified when querying in the language parameter.