Hello everyone,
after much research on the net, I am looking for a solution to this.
I’m building an API for data exchange between SAP B1 and an e-shop. For this I use the service layer of SAP B1, according to the doc mentioned here:
To illustrate my problem, here is a piece of code that works for the first query (I pass the connection and recovery of the session and others…), but the second poses a problem.
The service layer answers me: 400 Bad Request
<cfscript>
// session.serviceLayer.sessionID = "B1SESSION=692xxxxxxxxxxxxxxxxxx17;ROUTEID=.nodeXX" this is ok for other query
server = "https://10.10.0.10:50000"
businessPartnersURL = "/b1s/v1/BusinessPartners"
queryCount = "/$count?$filter=startswith(CardCode, 'C')"
queryMaxDate = "?$apply=aggregate(UpdateDate with max as MaxDate)"
// aggregate in page : 37 / 3.7.7.3 in SAP Doc
// this query (URL) works very well for example in postman.
cfhttp(method = "get", charset = "utf-8", url = server & businessPartnersURL & queryCount , result="resultQuery") {
cfhttpParam(type = "header", name="Cookie" , value = session.serviceLayer.sessionID );
};
cfhttp(method = "get", charset = "utf-8", url = server & businessPartnersURL & queryMaxDate , result="resultQuery") {
cfhttpParam(type = "header", name="Cookie" , value = session.serviceLayer.sessionID );
};
</cfscript>
Response queryCount : result-queryCount.png
Response queryMaxDate : result-queryMaxDate.png
Response queryMaxDate in postman :
An idea ? Am I wrong somewhere?
Thank you for your feedback
Christophe
PS: Sorry for English, I speak French