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

Community Tip - Your Friends List is a way to easily have access to the community members that you interact with the most! X

how to add service not a dynamic service in a thing via http request?

YC_10946483
5-Regular Member

how to add service not a dynamic service in a thing via http request?

In the thingworx plantform we  add service and open developer tool we can see we have send a http request as below,in the body there are a lot of   parameters,

is  there any document show  how to add those parameter?

YC_10946483_0-1709191236244.png

YC_10946483_1-1709191275293.png

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @YC_10946483 

 

You can use the below endpoint to add a service definition 

https://<<HOSTNAME>>/Thingworx/Things/<<THINGNAME>>/Services/AddServiceDefinition 

Method: POST

Body :
{
  name : "servicename",
  description : "Service description",
  category : "",
  parameters : INFOTABLE,
  resultType : INFOTABLE,
  remote : false,
  remoteServiceName : "",
  timeout : 1000
}

This will only create a service definition without any logic inside

 

To create logic refer this article - Solved: Create service programmatically - PTC Community

 

/VR

View solution in original post

2 REPLIES 2

Hi @YC_10946483 

 

You can use the below endpoint to add a service definition 

https://<<HOSTNAME>>/Thingworx/Things/<<THINGNAME>>/Services/AddServiceDefinition 

Method: POST

Body :
{
  name : "servicename",
  description : "Service description",
  category : "",
  parameters : INFOTABLE,
  resultType : INFOTABLE,
  remote : false,
  remoteServiceName : "",
  timeout : 1000
}

This will only create a service definition without any logic inside

 

To create logic refer this article - Solved: Create service programmatically - PTC Community

 

/VR

YC_10946483
5-Regular Member
(To:Velkumar)

Thanks a lot!

Top Tags