These are chat archives for nanafifieldsage/Sage-X3-Hackathon

5th
Jul 2016
Dave Laird
@l4rd
Jul 05 2016 05:13
Good morning hackathon - I'm feeling refreshed after a couple of hours sleep
Having a problem trying to create rows in X3 using an http post to an x3 representation, has anyone been able to do this?
Aurélien PISU
@pisua
Jul 05 2016 07:00
@l4rd can you set the error message if they are one in the room or call me if you've not succeed to resolve your issue Dave ?
Dominique BOPP
@dbopp
Jul 05 2016 07:06
You have to use http POST.
The URL starts with the server address and service , followed by /api/x3/erp/folder_name/class, then by ?representation=representation.$create.
The body contains the values of the properties.
Have a look at the following image, it shows an example with POSTMAN on a single YLEAD entity that is present on your SEED folder
The only point you should be aware is that X3 requires uuid values if you embed a collection (one per collection line). But on a simple class, it goes straightforward without any technical field.
blob
Dave Laird
@l4rd
Jul 05 2016 07:11
I'm doing a POST on /sdata/x3/erp/X3U9REF_SEED/YOPERATION?representation=YOPERATION.$create
But I don't get any error back
Let me try it in POSTMAN and see if I have any luck
Dominique BOPP
@dbopp
Jul 05 2016 07:12
the url must include api rather than sdata...
Dave Laird
@l4rd
Jul 05 2016 07:12
Also, how do I get it to drop the webclient session, I keep running out of licenses
Ah - api!
Dominique BOPP
@dbopp
Jul 05 2016 07:12
Next time we will provision more licenses. I didn't notice this stypid point
Dave Laird
@l4rd
Jul 05 2016 07:20
@dbopp @pisua - cool, it's working now!!
Another question...
Is it possible to POST multiple rows of data at the same time?
I'm just trying to think of ways around using up a client session every time I POST
Dominique BOPP
@dbopp
Jul 05 2016 07:22
Unfortunately no
Dave Laird
@l4rd
Jul 05 2016 07:25
Okay, but is there a way to reuse the session or drop it with another http call?
Dominique BOPP
@dbopp
Jul 05 2016 07:27
Yes, there is. You get the session cookie in the fist exchange, and you sent it back in the next calls. The session will be reused.