Navigation
Legacy
You're viewing the previous version. For the current product, see the v3 API reference.
Retrieve user devices
Retrieve the list of devices for an existing user. Supply the unique user ID from the Rupt SDK attach method.
Parameters
No parameters
Returns
Returns a list of device objects.
GET/v2/user/:id/devices
import axios from 'axios';
const { data } = await axios.get(
'https://api.rupt.dev/v2/user/USER_ID/devices',
{ headers: { Authorization: `Bearer ${API_SECRET}` } }
);
Response
[
{
"_id": "635940382397b3ac0b81c0b7",
"user": "649873be6e8b6f9b33722a0c",
"status": "attached",
"metadata": {
"key": "value",
},
"info": {
"device": {
"vendor": "Apple",
"model": "iPhone 12",
"type": "mobile"
}
},
"attachedAt": "2021-09-01T00:00:00.000Z",
"createdAt": "2021-09-01T00:00:00.000Z",
"updatedAt": "2021-09-01T00:00:00.000Z",
},
...
]