cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

POST JSON

Highlighted
Visitor

POST JSON

Hi,

I try to send a POST command to an API with this code :

 

var json = {
"machinecode": "E5",
"dispatchtypecode": "PANNE",
"description": "Temps de vide trop long > Chambre Droite",
"tradecode": "Maintenance"
};

var url1 = "https://xxx.com/api/1.0/dispatches/open/?auth=abcdefghij&site=50";

var params = {
headers: header /* JSON */,
url: url1 /* STRING */,
content: json /* JSON */
};

// result: JSON
var result = Resources["ContentLoaderFunctions"].PostJSON(params);

 

But I receive this return :

{"headers":"","success":false,"error":"Unexpected error in open. If problem persists contact Support."}

 

Could you help me, please ?

2 REPLIES 2

Re: POST JSON

Hello Philippe,

 

Were you ever able to find a resolution to this issue? If so could you please post a reply so other customers who are having the same issue are also able to resolve this.

Re: POST JSON

Hello,

 

I succeeded using PostText .

I posted here : https://community.ptc.com/t5/ThingWorx-Developers/POST-JSON/m-p/639366

Announcements

Thingworx Navigate content has a new home! Click here to access the new Thingworx Navigate forum! ______________________________