API - Uputstvo za prvo spajanje

SAOP API

Saop API is an interface/service for data exchange with ERP Saop. It is a WEBAPI interface with URL endpoint.

The structure of the input and output data is in XML format.

The interface runs on MS servers. Minimum requirements are version 2008 R2 with IIS and .Net version 4. The Saop API supports the use of pagination (Page and Page Size) on the output side, as well as use of time filters, for requesting data that has changed since last successful service request.

At the time of implementation, Seyfor will supply you with information for authentication and documentation / structures for the API methods you will be using. You will be supplied with a parallel environment (copy of the production environment) on which you will run your development.

Seyfor will supply you with:

  • Endpoint (WEB) URL

  • Organization ID

  • Username

  • Password

Usage

To get the CURL sample, you will need to send a request using the Swagger tool, which is a part of Saop API environment. Following are the steps for the CURL sample:

Login to Swagger

  1. Copy & Paste the API URL into your web browser. Swagger will then start:

  1. In the header (top right corner) insert the Organization ID, Username and Password which were supplied by Seyfor.

GET Method sample

  1. In the following example is a request for list of countries using the method Country GET/api/countries. Click »Try it out!«.

  1. Check the Response. In case of a successful request, API service returns the »Response code« 200 (HTTP status codes). In the field »CURL« there is a CURL sample, which returns the endpoint, authorization, request example and the response.

  2. The authorization in CURL is the one to use for the requests sent via third party applications. Username and password are meant to be used only for the requests on Swagger.

POST Method sample

  1. The same rules apply for the POST methods. Seyfor will supply you with XML examples for the methods you will be using. You will have to replace the data in the examples with customer data and repeat the steps described above (1. and 2.).

  2. Following is an example of using the POST method for Customers.

  3. Select »Customer« from the list, expand it and select method »/api/Customers/AddCustomer«. Paste your XML in field »CustomerClass« and click »Try it out!«.

  4. Check the response. In case of a successful request the response HTTP status code will be 200. CURL example of the request is supplied by Seyfor.

  5. Some GET methods (i. e. Documents) need the input parameters to be supplied by XML. The samples will be supplied by Seyfor and you can view them in Swagger as well.

U ovom članku