***Antipattern***
Count: 22
- /me/resources/description  Get thing's description There is a special resource called description that can contains meta data about the thing. This meta data could be the name of the thing (chosen by the user), geocoordinates, JSON objects and any other data the developer wants to put there. This resource is accessible the same way as all the resources with get and put requests. Before you modify this resources, you have to get the actual description value, change the properties you want to modify and then store the complete document again.
- /me/resources  Get resources Get the user's resources and the things associated to each resource.
- /me/settings  Update User Settings Sometimes the app needs to store additional data about the user like gender, avatar, hair color, etc. In that case the app can use the endpoint '/me/settings' in order to set and get the users settings. The users settings are not meant to store large amounts of data. Its more likely a small key/value store. Updates the settings key/value object. There is a special key password that will update the users password with the app.
- /classes/me/ID_COLLECTION  Get collection of objects Returns all the collection's objects sorted by primary key in descending order.
- /me/things  Link thing Before getting the user's data from a thing, a procedure called link thing is necessary, which allows the platform to know that the user is the owner of the thing. This procedure needs a thing token (or the thing ID) and a session token. And it requires some kind of direct communication between the app and the thing. For example, when setting up the network for the thing and the SSID and password are sent to the thing, it is a good moment to ask for the thing token of the thing. With this thing token, the app will be able to do the REST call to link the thing to the user and store the relation at the platform. Note that in order to link the thing the user must be logged in and the thing must be activated (i.e. have a thing token)
- /me/grant  Grant Asks the user to grant permissions to the app, so the app can access the user's resources.
- /classes/me/ID_COLLECTION  Store an object This endpoint lets you store an object as a JSON string. If you dont specify an _id, the system will automatically assign a random ID. Returns error if the _id already exists for that collection.
- /classes/me/ID_COLLECTION?subscribe=true&keepAlive=TIME_MS  Subscribe to collection Subscribes to collection updates. When somebody updates the collection you will be notified.
- /things/THING_TOKEN/tags  Add TagAdd tag to a thing.
- /me/grant  Sharing resources When a user wants to give access to his or her resources to another user, the app can grant the endpoint. But this time the app has to pass the email of the granted user. The granted user will also receive an email to confirm this action.
- /me/resources/RESOURCE?subscribe=true&keepAlive=TIME_MS  Subscribe to resource values Endpoint to subscribe to the real-time updates. Once subscribed, you will receive a message each time that the resource receives a new value. If there are no updates the server will send {} after the interval you specified for keepAlive. You should also keep a timer, and if you dont receive updates after the keepAlive time is expired, you have to resubscribe. This could happen if the Wi-Fi is down or something happens to the connection. To subscribe from a browser we recommend to use Websocket. REST API subscription is not reliable on browsers.
- /utils/date/?format=FORMAT  Get Server Date Retrieve the date of the server. The parameter format accepts two values: 'UTC' and 'unix_timestamp'.
- /me/resources/RESOURCE  Get resource values This endpoint returns the values of the specified resource.
- /me/settings  Get User Settings Sometimes the app needs to store additional data about the user like gender, avatar, hair color, etc. In that case the app can use the endpoint '/me/settings' in order to set and get the users settings. The users settings are not meant to store large amounts of data. Its more likely a small key/value store. Retrieve the settings object.
- /me/things  Link a thing from an app with the thing token The easiest way to link a thing is when the user provides the thing token to the app. The thing token could be printed in the users' manual, or printed on a card inside the packaging or received after registering the thing at your product's web. There are many ways to do this. After this, the app has access to the user's thing data.
- /things/ID_COLLECTION/PRIMARY_KEY  Update an object Change the values of an object. If there are some values which are not overwritten, these values will not be deleted.
- /me/things  How to Unlink a thing If you want to remove the ownership of a thing from a user, a procedure called unlink thing is necessary which allows the platform to know that the user is no longer the owner of the thing. In order to unlink the thing the user must be logged in and the thing must be activated and previously linked. Unlink thing from an app with the thing ID The thing lD could be retrieved from the GET:/me/things or GET:/me/resources After this, the app does not have access to the user's thing data anymore.
- /things/THING_TOKEN/resources/$MAGIC_RESOURCE  Thing Magic Resources Read Magic resources are specials resources that start with $, and have some special behaviors, like trigger some common task, or update static data. These resources can be used as the others using read and write operations.
- /me/resources/description/THING_ID  Update thing's description There is a special resource called description that can contain meta data about the thing. This meta data could be the name of the thing (chosen by the user), geocoordinates, JSON objects and any other data the developer wants to put there. This resource is accesible the same way as all the resources with get and put requests. Before you modify this resources, you have to get the actual description value, change the properties you want to modify and then store the complete document again.
- /things/THING_TOKEN/tags/TAG_ID  Delete Tags
- /classes/me/ID_COLLECTION/PRIMARY_KEY  Delete an object Delete an object by _id.
- /classes/me/ID_COLLECTION/PRIMARY_KEY  Get Object Returns the object stored with the specified key.

***Pattern***
Count: 11
- /things/THING_TOKEN/resources/RESOURCE_KEY  This method returns the values of the resource with the specified RESOURCE_KEY from the corresponding THING_TOKEN. To read data, use the operation GET /things/ with the thing token and the key that you are using to store the values.
- /things/THING_TOKEN/firmwares/download/FIRMWARE_ID  Download firmware Download the firmware using the firmware ID (from the previous API call) and thing token.
- /things/THING_TOKEN  Writes the records of data from the thing to the specified THING_TOKEN. Only alphanumeric characters and ., -,  symbols are admited for the resource name key.
- /things/THING_TOKEN/tags  Get Tags Returns the tags of the thing.
- /things/THING_TOKEN/firmwares/latest  Get latest firmware version Query for the latest firmware informations for the model of the thing corresponding to the specified thing token. It will return all latest firmware registered for every micro-controller (MCU).
- /things  Activates a thing with an activation code. The result is a thing token. You will be able to retrieve this thing token at any time from the panel.
- /things/THING_TOKEN  Thing Subscribe With this method you can subscribe to the thing channel and get real-time updates from all the thing's keys (resources). The subscription endpoint creates a streaming channel and we keep the channel open depending on the keep alive that you send. If no keep alive is set, your router or our server will close the channel at its sole discretion. You will need a compatible client. To subscribe from a browser we recommend to use Websocket. REST API subscription is not reliable on browsers. To test the real-time updates from the command line, you will need to open two consoles. One for the subscription curl command, and another to do the curl write commands.
- /things/THING_TOKEN  Thing Magic Resources Write Magic resources are specials resources that start with $, and have some special behaviors, like trigger some common task, or update static data. These resources can be used as the others using read and write operations.
- /login  Login an app user at thethings.iO Platform. Returns the session token and roles. The object roles identifies the resources and things that the user has authorized the app to access.
- /register  Register an app user at thethings.iO Platform. This endpoint also logs the user in (returns the session token and roles), so you don't have to do another API call to log him in.
- /things/THING_TOKEN/resources  Get Resources Returns the names of the resources of the thing.
