POST päring: erinevus redaktsioonide vahel

Allikas: Excellent || Opendoc
Mine navigeerimisribale Mine otsikasti
1. rida: 1. rida:
[[Hausing|Hausing - Pealeht]]
[[Hausing|Hausing - Pealeht]]
 
===Päring===
==POST==
====Autoriseerimine URL'i abil====
===Request===
====With authorization in URL====
<syntaxhighlight>
<syntaxhighlight>
http://username:password@ipAddress:portNumber/WebPOSTAPI.hal?company=compNumber&param2=value&param3=value
http://username:password@ipAddress:portNumber/WebPOSTAPI.hal?company=compNumber&param2=value&param3=value
</syntaxhighlight>
</syntaxhighlight>
====With authorization in request header====
====Autoriseerimine päringu päises====
<syntaxhighlight>
<syntaxhighlight>
http://ipAddress:portNumber/WebPOSTAPI.hal?company=compNumber&param2=value&param3=value
http://ipAddress:portNumber/WebPOSTAPI.hal?company=compNumber&param2=value&param3=value
and additional header
and additional header
   Authorization: Basic [base64 encoded user:password string]
   Authorization: Basic [base64 encoded user:password string]
</syntaxhighlight>Required parameters:
</syntaxhighlight>Nõutud parameetrid:
*compNumber is the sequence number of the company in Hansa DB starting from 1
*compNumber on ettevõtte number Standard Books ettevõtete registris. (Numberatsioon algab 1'st)
Optional parameters:
Näide:<syntaxhighlight>
*TBD
Example:<syntaxhighlight>
http://testuser:testpassword@localhost:1639/WebPOSTAPI.hal?company=1
http://testuser:testpassword@localhost:1639/WebPOSTAPI.hal?company=1
</syntaxhighlight>
</syntaxhighlight>
====Request headers====
====Päringu päis====
Request header must contain at minimum the following header:
Päringu päise kohustuslikud osad:
*Content-Type: application/xml
*Content-Type: application/xml
In order to authorise not from URL but with POST request, additional header is required
Kui kasutada autoriseerimist POST päringu päises, tuleb päringu päisesse lisada järgnevad osad:
*Authorization: Basic [base64 encoded user:password string]
*Authorization: Basic [base64 encoded user:password string]
**''example Authorization: Basic YXBpOmFwaQ==''
**''example Authorization: Basic YXBpOmFwaQ==''

Redaktsioon: 8. august 2018, kell 09:49

Hausing - Pealeht

Päring

Autoriseerimine URL'i abil

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

Autoriseerimine päringu päises

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

Nõutud parameetrid:

  • compNumber on ettevõtte number Standard Books ettevõtete registris. (Numberatsioon algab 1'st)

Näide:

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

Päringu päis

Päringu päise kohustuslikud osad:

  • Content-Type: application/xml

Kui kasutada autoriseerimist POST päringu päises, tuleb päringu päisesse lisada järgnevad osad:

  • 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.

Lisamine/Muutmine/Kustutamine