JavaScript
import Mobilerun from '@mobilerun/sdk';
const client = new Mobilerun({
apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
});
const device = await client.devices.setName('deviceId', { name: 'x' });
console.log(device.id);import os
from mobilerun_sdk import Mobilerun
client = Mobilerun(
api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"), # This is the default and can be omitted
)
device = client.devices.set_name(
device_id="deviceId",
name="x",
)
print(device.id)package main
import (
"context"
"fmt"
"github.com/stainless-sdks/droidrun-cloud-go"
"github.com/stainless-sdks/droidrun-cloud-go/option"
)
func main() {
client := mobileruncloud.NewClient(
option.WithAPIKey("My API Key"),
)
device, err := client.Devices.SetName(
context.TODO(),
"deviceId",
mobileruncloud.DeviceSetNameParams{
Name: "x",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", device.ID)
}mobilerun-cloud devices set-name \
--api-key 'My API Key' \
--device-id deviceId \
--name xcurl --request PUT \
--url https://api.mobilerun.ai/devices/{deviceId}/name \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mobilerun.ai/devices/{deviceId}/name",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.put("https://api.mobilerun.ai/devices/{deviceId}/name")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mobilerun.ai/devices/{deviceId}/name")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"activeTaskId": "<string>",
"assignedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"id": "<string>",
"name": "<string>",
"state": "<string>",
"stateMessage": "<string>",
"streamUrl": "<string>",
"taskCount": 123,
"terminatesAt": "2023-11-07T05:31:56Z",
"type": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"$schema": "<string>",
"billingStrategy": "<string>",
"createdBy": "<string>",
"ownerId": "<string>",
"providerId": "<string>",
"streamToken": "<string>",
"userId": "<string>"
}{
"$schema": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}Devices
Update device name
Sets the display name for a device from the name in the request body and returns the updated device.
PUT
/
devices
/
{deviceId}
/
name
JavaScript
import Mobilerun from '@mobilerun/sdk';
const client = new Mobilerun({
apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
});
const device = await client.devices.setName('deviceId', { name: 'x' });
console.log(device.id);import os
from mobilerun_sdk import Mobilerun
client = Mobilerun(
api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"), # This is the default and can be omitted
)
device = client.devices.set_name(
device_id="deviceId",
name="x",
)
print(device.id)package main
import (
"context"
"fmt"
"github.com/stainless-sdks/droidrun-cloud-go"
"github.com/stainless-sdks/droidrun-cloud-go/option"
)
func main() {
client := mobileruncloud.NewClient(
option.WithAPIKey("My API Key"),
)
device, err := client.Devices.SetName(
context.TODO(),
"deviceId",
mobileruncloud.DeviceSetNameParams{
Name: "x",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", device.ID)
}mobilerun-cloud devices set-name \
--api-key 'My API Key' \
--device-id deviceId \
--name xcurl --request PUT \
--url https://api.mobilerun.ai/devices/{deviceId}/name \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mobilerun.ai/devices/{deviceId}/name",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.put("https://api.mobilerun.ai/devices/{deviceId}/name")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mobilerun.ai/devices/{deviceId}/name")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"activeTaskId": "<string>",
"assignedAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"id": "<string>",
"name": "<string>",
"state": "<string>",
"stateMessage": "<string>",
"streamUrl": "<string>",
"taskCount": 123,
"terminatesAt": "2023-11-07T05:31:56Z",
"type": "<string>",
"updatedAt": "2023-11-07T05:31:56Z",
"$schema": "<string>",
"billingStrategy": "<string>",
"createdBy": "<string>",
"ownerId": "<string>",
"providerId": "<string>",
"streamToken": "<string>",
"userId": "<string>"
}{
"$schema": "<string>",
"detail": "<string>",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "<string>",
"status": 123,
"title": "<string>",
"type": "about:blank"
}Authorizations
Bearer token via Authorization header
Path Parameters
Body
application/json
Required string length:
1 - 255Response
OK
A URL to the JSON Schema for this object.
Example:
"https://example.com/schemas/DeviceInfo.json"
Deprecated: use ownerId/createdBy.
Was this page helpful?
⌘I