ThingWorx REST API > Updating, Deleting, and Executing Through the API
Updating, Deleting, and Executing Through the API
* 
The examples in this topic assume that you are familiar with executing HTTP POSTS in your web development environment or application.
The following rules help to understand what is needed based on the type of request being made.
Notes
Sample URL
HTTP Action
Content Type
UPDATE
Updates require specifying the entity part as well
http://host/Thingworx/Things/thing_name
PUT
application/json or text/xml
DELETE
Deletes require specifying the entity part as well
http://host/Thingworx/Things/thing_name
DELETE
n/a
INVOKING SERVICES
Calling a service requires specifying the complete URL, including the specific characteristic
http://host/Thingworx/Things/MyThing/Services/myService
* 
If your service requires inputs, these inputs should be passed in the form fields of your POST.
POST
application/json
Executing HTTP Requests
When executing HTTP requests, use UTF-8 encoding and specify the optional port value if required.
* 
It is recommended to use HTTPS in production or any time network integrity is in question.
Handling HTTP Response Codes
In most cases, you should expect to get back either content or the status code of 200, this is OK. In the case of an error, you will receive an error message.
Working with HTTP Content
If you are sending or receiving any HTTP content (JSON, XML, HTML (for responses only)), set the request content-type header to the appropriate value based on the HTTP content you are sending.
Methods
GET
Retrieve a value.
PUT
Write a value or create new Things or properties.
POST
Execute a service.
DELETE
Delete a Thing or Property.
Accept Header Values
JSON
application/json
XML
text/xml
HTML
text/html (or omit Accept header)
CSV
text/csv
Content Type Header Values
JSON
application/json
XML
text/xml
Metadata
You can display the metadata of any specific Thing, Thing Template, or Shape you build by going to the following URL in a web browser: NameoftheThing/Metadata
* 
To see this information, it must be shown as JSON.
Passing in Authentication with your REST API Call
Although you can pass in a user name and password with your REST call, the recommended best practice is to use an application key. Generate the application key in ThingWorx and then you can pass it with your REST call.
https://www.MyThingWorxApp.com/Thingworx/Things/RefrigeratedTruck_04789/Properties/CurrentTemperature
* 
If your service requires inputs, these inputs should be passed in the form fields of your POST.
value=xyz&appKey=1CB45438-C0B7-4812-B95C-892762FDA0CC
* 
The appKey URL parameter will be deprecated in a future release.
Related Links