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

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

how can i Invoking a service by REST API ?

ikhalil
7-Bedrock

how can i Invoking a service by REST API ?

I am facing a problem. can't invoke a service using REST API. I wanna execute a service while REST API is called. i try to do this by this link http://MyServer//Thingworx/Things/UtilityThing/Services/CreateThings . But this is not working. Is there any other way to do this.

ACCEPTED SOLUTION

Accepted Solutions
ikhalil
7-Bedrock
(To:ikhalil)

Thank you every one. The problem is solved.

View solution in original post

7 REPLIES 7
paic
12-Amethyst
(To:ikhalil)

If you are doing this externally it has to be a POST

There is a lot of good content available on the REST API in this forum and on support.ptc.com, I recommend you do a search.

Also there is a dedicated section in the Java Doc.

Don't forget to check the box in the PlatformSubsystem under the Configuration section for "Allow Request Method Switch". If you don't do this all of your POSTs will be GETs instead and prevent you from exercising any services.

ckulak
12-Amethyst
(To:mhollenbach)

Hello Meghan,

My understanding was that "Allow Request Method Switch" allows you to replace POST with GET + "&method=post" parameter, which is outdated and discouraged practice left mainly for compatibility with legacy clients which couldn't send HTTP POST.

Please correct me if I'm wrong.

/ Constantine

mhollenbach
12-Amethyst
(To:ckulak)

Clarification: This is only if you are directly invoking the request within a browser and not from an external source.

ckulak
12-Amethyst
(To:ikhalil)

Hello Ibrahim,

That's how you do it:

post-request.png

Regards,

Constantine

ikhalil
7-Bedrock
(To:ikhalil)

Thank you every one. The problem is solved.

ikhalil
7-Bedrock
(To:ikhalil)

I just added appKey with the link.

Announcements


Top Tags