Api requests
Calling an X3 service is based on URLs called in http mode.
The syntax of the URL is the following:
* The server and the service are given first, followed by api1 (for example, http://my_server:service/api1/
).
The application and contract. For Sage X3, it can be either x3/$$prod/
when an $$PROD resource is concerned, or syracuse/collaboration/
for collaboration entities.
The endpoint:
syracuse/
.X3/
.The entity, followed by a key value between parenthesis if access to a single resource is requested. For example, BPCUSTOMER
to access the customer (BPCUSTOMER) entity, and BPCUSTOMER('MARTIN')
to access the MARTIN customer.
Additional parameter given by ?param1=value1¶m2=value2&...
. The most frequent parameters are listed as follows:
representation=REP.$FAC
where REP
is the representation name and FAC
the facet name.&where=COND
, COND
being the condition in api1 syntax (used in queries).&orderBy=FIELD1;FIELD2 Desc
(used in queries).&count=20
(used in queries).Even if it seems to work, sdata
must no longer be used in webservice mode. Indeed, sdata
is dedicated to inactive sessions and consumes a token.
In all these examples, ...
stands for the server and the service followed by api1. For example, if the server is called my_server
, and if the service is 8124, ...
must be replaced by http://my_server:8124/api1
.
To get the list of the endpoints (with a maximum of 100) of the platform on a server called my_server, with the service 8124:.../syracuse/collaboration/syracuse/endPoints?representation=endPoints.$query&count=100
.
To get the list of documents on the volume DOC: .../syracuse/collaboration/syracuse/documents?representation=documents.$query&where=(volume.code eq 'DOC')
.
To get a list of customers on a folder DEMO order by name (property BPCNAM):.../x3/$$prod/DEMO.BPCUSTOMER?representation=BPCUSTOMER.$query&count=20&orderBy=BPCNAM desc
.
To get the details on an endpoint by giving its unique ID:.../syracuse/collaboration/syracuse/endPoints('5cceca60-c5a2-4ddf-b248-426fc5ce7cfb')?representation=endPoint.$details
.
To get the details of the customer MARTIN:.../x3/$$prod/DEMO.BPCUSTOMER('MARTIN')?representation=BPCUSTOMER.$details
.
To create a resource for a given entity, a POST will be done on the following URL:.../x3/$$prod/DEMO.BPCUSTOMER?representation=BPCUSTOMER.$edit
.