POST päring: erinevus redaktsioonide vahel

Allikas: Excellent || Opendoc
Mine navigeerimisribale Mine otsikasti
Resümee puudub
12. rida: 12. rida:
and additional header
and additional header
   Authorization: Basic [base64 encoded user:password string]
   Authorization: Basic [base64 encoded user:password string]
</syntaxhighlight>''UKU testdatabase:''<syntaxhighlight>
</syntaxhighlight>Required parameters:
HTTPS
  https://s001.excellent.ee:6443/WebPOSTAPI.hal?company=1
HTTP
  http://s001.excellent.ee:1639/WebPOSTAPI.hal?company=1
</syntaxhighlight>Companies implemented 1,2,3,4,5
 
'''User''': API
 
'''Password''': api
 
Required parameters:
*compNumber is the sequence number of the company in Hansa DB starting from 1
*compNumber is the sequence number of the company in Hansa DB starting from 1
Optional parameters:
Optional parameters:

Redaktsioon: 6. august 2018, kell 13:19

Hausing - Pealeht

POST

Request

With authorization in URL

http://username:password@ipAddress:portNumber/WebPOSTAPI.hal?company=compNumber&param2=value&param3=value

With authorization in request header

http://ipAddress:portNumber/WebPOSTAPI.hal?company=compNumber&param2=value&param3=value
and additional header
  Authorization: Basic [base64 encoded user:password string]

Required parameters:

  • compNumber is the sequence number of the company in Hansa DB starting from 1

Optional parameters:

  • TBD

Example:

http://testuser:testpassword@localhost:1639/WebPOSTAPI.hal?company=1

Request headers

Request header must contain at minimum the following header:

  • Content-Type: application/xml

In order to authorise not from URL but with POST request, additional header is required

  • Authorization: Basic [base64 encoded user:password string]
    • example Authorization: Basic YXBpOmFwaQ==
  • JSON not supported at the moment

Request body (POST data) format

Must be in XML format.

General format template as follows.

Notes:

  • <rows> element is optional;
  • IVVc is the internal system name of Invoice register in Hansa. Only following registers are supported at the moment:
    • IVVc - Invoices
    • CUVc - Contacts
    • INVc - Items
  • the register name (“IVVc”) is now included into <data> element of request body, but is subject to review and may be moved to URL as parameter instead.
  • Possible to pass several <IVVc> elements to send several records.
  • “method” attribute of the <data> element defines the action. Actions supported at the moment: “create”, “delete”.
  • sequence="106357" systemversion="8.4.20.504" are not used in API right now, only used for example, can ignore it for the moment.