Usage
remote.it is in the process of making available all functions in graphQL and will be eventually deprecate the REST-API. This documentation provides the REST-API where the function is not available via graphQL.

What is GraphQL?

GraphQL is a data query language for API's, developed by Facebook in 2012 before being publicly released in 2015. GraphQL provides an alternative to the REST API.
For more information on GraphQL, learn on the official GraphQL website here.

How to Access GraphQL

https://api.remote.it/graphql/v1 Continue through this documentation to learn about our schema and some useful examples.
remote.it authentication uses HTTP Request Signature; more on Authentication can be found here.

GraphQL Clients (Developer Tools)

These are some of the most popular developer tools used with GraphQL API's which you can use to explore the schema.
We provide some basic setup and usage for the Insomnia client here.
You can view our visual schema reference here.

Schema Definitions

GraphQL endpoint supports introspection queries via the __schema query.

We recommend using a GraphQL client (Developer Tools) to introspect and explore the schema.

Configure your GraphQL client to use the API endpoint:
https://api.remote.it/graphql/v1
Schema convention is to use upper camel case for object types and lower camel case for property names.
Note that these objects and parameters are continually enhanced. Please use your IDE for the most up to date schema. The changes are designed to be non-breaking by adding rather than deleting or changing existing definitions.
Basic types are:
  • ID (similar to the string type but used for object IDs)
  • String
  • Int
  • Float
  • Boolean
  • DateTime (ISO 8601 format Date String)

Queries

Queries are requests which read the data and will not change the data. All queries will be in context of the user associated with the access key and secret. The usage examples include a variable section which will need to accompany the query or alternatively, you can put the values inline.

Fetching updates

If you're working on building an application which display data and you want the status information to update (near) realtime, use the webhook. To prevent excessive usage of our API, we recommend that you be mindful about your implementation.
Do's:
  • Register a programmatic webhook and get updates for status changes on your devices. When you detect changes, update the device information
Dont's:
  • Poll updates for each device. There should never be a reason to do this, unless in small cases and your application might get rate limited. See above tactics to implement this better.

Mutations

Mutations are requests which update data. All mutations are in context of the user associated with the access key and secret.
In the case where we do not have the functionality supported, the REST-API examples are provided. These will be updated from time to time as remote.it migrates to support graphQL only.

Pagination

The list responses from the devices and event log queries return paginated results. We implement a pagination model with from/after and size pagination arguments. Responses can return hasMore, last and total . If the hasMore response returns true, this indicates do another fetch. In this case, the from will increment to 1001 to fetch the next set. You could also determine this by iteration until you get to the total. Size is limited to 1000 max in each return.
1
#Query
2
3
query getDevices($size: Int, $from: Int, $sort: String) {
4
login {
5
devices(size: $size, from: $from, sort: $sort) {
6
total
7
hasMore
8
items {
9
id
10
name
11
hardwareId
12
created
13
services {
14
id
15
name
16
}
17
}
18
}
19
}
20
}
21
22
#Variables
23
{
24
"size": 1000,
25
"from": 0,
26
"sort": 'name',
27
}
Copied!
Result Response
1
{
2
"data": {
3
"login": {
4
"devices": {
5
"total": 1200,
6
"hasMore": true,
7
"items": [
8
{
9
"id": "8X:XX:XX:00:29:01:8e:ed",
10
"name": "bento",
11
"hardwareId": "dc:a6:32:19:8b:a3-xWoYf46uJ6QdtPXTloLb",
12
"created": "2019-12-20T22:13:46.000Z",
13
"services": [
14
{
15
"id": "8X:XX:XX:00:29:01:8e:ed",
16
"name": "ssh service"
17
}
18
]
19
},
20
...
21
]
22
}
23
}
24
}
25
}
Copied!
Last modified 4mo ago