Api requests
Calling an X3 service is based on URLs called in http mode.
URL syntax
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, orsyracuse/collaboration/
for collaboration entities. -
The endpoint:
- For collaboration entities, the endpoint is always
syracuse/
. - For Sage X3 entities, the endpoint corresponds to a Sage X3 folder and is defined in the endpoints entity of the platform, for example
X3/
.
- For collaboration entities, the endpoint is always
-
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, andBPCUSTOMER('MARTIN')
to access the MARTIN customer. -
Additional parameter given by
?param1=value1¶m2=value2&...
. The most frequent parameters are listed as follows:- The representation and the facet, which are mandatory, in the following format:
representation=REP.$FAC
whereREP
is the representation name andFAC
the facet name. - Where clauses such as
&where=COND
,COND
being the condition in api1 syntax (used in queries). - Ordering clauses such as
&orderBy=FIELD1;FIELD2 Desc
(used in queries). - Additional parameters such as
&count=20
(used in queries).
- The representation and the facet, which are mandatory, in the following format:
Note
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.
Examples
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
.
Lists
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
.
Details
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
.
Creation
To create a resource for a given entity, a POST will be done on the following URL:.../x3/$$prod/DEMO.BPCUSTOMER?representation=BPCUSTOMER.$edit
.