REST API 2021-11-17 webinar Q&A
Giedrius Kurlavicius
11-29-21
Operating system: macOS
Q: Is it planned to cut support for XML or keep both XML and JSON supported equally?
A: At the moment we plan to support both equally. There is one feature that is specific to JSON - you can POST JSON format record, but you can not POST an XML format record. It’s possible that we will add this in the future.

Q: Is it possible to update a block?
A: No, at the moment it is only possible to read the blocks.


Q: How do you patch a record where one of the key segments is empty? For example, PIVc where Location is blank.
A: If you want to patch a record with empty key segment, you need to put 2 slashes with no data in between - it will have empty value. If the last field is empty, then just need to leave slash at the end of the url.


Example:
Code Item 10101
Code Location -blank
Code Group FOOD


curl -X GET \
-H "Accept: application/json" \
-H “Content-Type: application/json" \
-d ‘{“data”:{“MyVc”:[{“Field”:”Data”}]}}’ \
'http://SJ:Sample99@localhost:8033/api/1/MyVc/10101//FOOD’

Q: With the XML method at least, I think using // for the blank parameter doesn't work.
A: It should be fixed in the latest development versions, please test.


Q: How do you patch a record like a purchase item where 2 fields form part of the primary ID of the record?
A: You need to specify these fields in order.

Example:
RecordBegin(RegisterVc,-,"");
...

MainKeyBegin(MainKey,0);
KeySegment(Field1);
KeySegment(Field2);
KeySegment(Field3);

/api/1/RegisterVc/Field1/Field2/Field3

Empty fields are left blank, so

Field1="ONE"
Field2=""
Field3="THREE"

/api/1/RegisterVc/ONE//THREE


Q: How to patch/post record rows?
A: You have a special field called “Rows”, in the “Rows” you have an array and in the array you have one object for each row.

Example:
{
SerNr: 1234,
CustCode: "001",
rows: [ { stp: 1, spec: "item name one" },
{ stp: 1, spec: "item name two" } ]
}

Q: Is there a plan to add window actions to JSON post and patch?
A: There is no plan to do this.

Q: Have you tested the performance difference between XML and JSON GET?
A: There should not be a performance difference, same code outputs XML and JSON. Performance difference will be in sending data over the network - JSON format is more compact and uses less data than XML.

Q: XML line brakes have disappeared in the newest ERP. Is it a feature or a bug?
A: It might be that something small was changed in the XML output format. If the format is different, but still valid XML, then it's a change that will stay there. If some data that is in the database is now not sent, then it’s a bug that we will fix. Please report.

Q: Does HW plan to add a way to delete a record via API?
A: It’s possible to add, but we haven't seen enough use for it. If the feature is needed, please argue for it.


Q: Are there plans to return register fields data types, probably in .xsd (or other format), so we could properly detect data types on our end?
A: It was considered, but not implemented. Please let us know if there is a good reason to implement. Data should be understood at a higher level - developers need to understand the code and how fields are used before doing something with them, so data type registers are not particularly useful in this case.

Q: How are SSL certificates set up for HW Cloud hosted customers?
A: We have implemented an automatic routine for SSL certificate installation.


Q: Is there any plan to implement webhooks? (A webhook is a way for an app to provide other applications with real-time information.)
A: There are some plans in this direction, but it’s not yet clear what and when.
12-8-21
Is there going to be a new Technical White Paper for the API?
Giedrius Kurlavicius
1-12-22
Most recent REST API information can be found in HansaManuals (http://www.hansamanuals.com/main/mailnumber___61047/theconf___1145/manuals/version___85/english/hwconvindex.htm?shortcode=HW0801TECH_REST_API)

In the future we will update Partner Portal REST API section (https://partners.hansaworld.com/restapi-docs) and White Paper with newest information also.
Leave Comment
You can subscribe to notifications for this post by selecting the 'star' icon on the top right corner of the post.
Back to the list
Latest Posts
Reino Botha
Please check your version of android if it is the same as the server you are connecting too. ...
08:24 21 Nov 2024
Bror-Erik Kotiranta
In NC you hace operations>>ai chats. They are used for these Br, Bror-Erik...
05:12 21 Nov 2024