setDeviceProfile
Apply device profile to one or more devices.
You can assign a profile to a maximum of 1000 device IDs per call
setDeviceProfile(
profileId: ID!
deviceIds: [ID!]!
): [Device!]!
Arguments
setDeviceProfile.profileId ● ID! non-null scalar common
setDeviceProfile.deviceIds ● [ID!]! non-null scalar common
Type
Device object devices
Contains information about a Device in the system
Code Samples
- cURL
- JavaScript
- Python
- Go
curl -X POST https://graphql.pointonenav.com/graphql \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_TOKEN" \
-d '{
"query": "mutation SetDeviceProfile($profileId: ID!, $deviceIds: [ID!]!) { setDeviceProfile(profileId: $profileId, deviceIds: $deviceIds) { id label profile { id name } } }",
"variables": {
"profileId": "your-profile-id",
"deviceIds": [
"your-device-id"
]
}
}'
const mutation = `
mutation SetDeviceProfile($profileId: ID!, $deviceIds: [ID!]!) {
setDeviceProfile(profileId: $profileId, deviceIds: $deviceIds) {
id
label
profile {
id
name
}
}
}
`;
const variables = {
"profileId": "your-profile-id",
"deviceIds": [
"your-device-id"
]
};
const response = await fetch('https://graphql.pointonenav.com/graphql', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN'
},
body: JSON.stringify({
query: mutation,
variables: variables
})
});
const data = await response.json();
console.log(data);
import requests
import json
mutation = """
mutation SetDeviceProfile($profileId: ID!, $deviceIds: [ID!]!) {
setDeviceProfile(profileId: $profileId, deviceIds: $deviceIds) {
id
label
profile {
id
name
}
}
}
"""
variables = {
"profileId": "your-profile-id",
"deviceIds": [
"your-device-id"
]
}
response = requests.post(
'https://graphql.pointonenav.com/graphql',
json={
'query': mutation,
'variables': variables
},
headers={
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_TOKEN'
}
)
data = response.json()
print(json.dumps(data, indent=2))
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
type GraphQLRequest struct {
Query string `json:"query"`
Variables interface{} `json:"variables"`
}
func main() {
mutation := `
mutation SetDeviceProfile($profileId: ID!, $deviceIds: [ID!]!) {
setDeviceProfile(profileId: $profileId, deviceIds: $deviceIds) {
id
label
profile {
id
name
}
}
}`
variables := map[string]interface{}{
"profileId": "your-profile-id",
"deviceIds": ["your-device-id"],
}
reqBody := GraphQLRequest{
Query: mutation,
Variables: variables,
}
jsonData, _ := json.Marshal(reqBody)
req, _ := http.NewRequest("POST", "https://graphql.pointonenav.com/graphql", bytes.NewBuffer(jsonData))
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_TOKEN")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
var result map[string]interface{}
json.NewDecoder(resp.Body).Decode(&result)
fmt.Printf("%+v\n", result)
}