User and Device Management Copied!

This Section provides the APIs useful for managing and creating teams and device groups and allocating the device groups to teams.

User Copied!

The User section provides access to user-related information and functionality within the TestGrid. The users can retrieve, manage, and perform actions on user data, such as retrieving user details, updating user information, and accessing user-related resources.

Languages Box
cURL cURL
Ruby Ruby
Python Python
PHP PHP
Java Java
Node.js Node.js
Go Go
.NET .NET

Get User Token Copied!

The get user token section allows users to retrieve a unique token by providing their email and password. This token can be used for subsequent API calls to authenticate the user and access protected resources within the TestGrid API Project. Note : We support form data and form URL encoded data formats.

Body Parameters

email string Required
The email address associated with the user.
password string Required
The password for the user's account.
POST /api/get-usertoken
curl --location 'https://your_domain.testgrid.io/api/get-usertoken' \
--form 'email="<Your_Email>"' \
--form 'password="<Your_Password>"'
require "uri"
require "json"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/get-usertoken")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request.body = JSON.dump({
"email": "<Your_Email>",
"password": "<Your_Password>"
})
response = https.request(request)
puts response.read_body
import requests
import json

url = "https://your_domain.testgrid.io/api/get-usertoken"

payload = json.dumps({
"email": "<Your_Email>",
"password": "<Your_Password>"
})
headers = {
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
<?php
$client = new Client();
$headers = [
];
$body = '{
"email": "<Your_Email>",
"password": "<Your_Password>"
}';
$request = new Request('POST', 'https://your_domain.testgrid.io/api/get-usertoken', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{
\"email\": \"<Your_Email>\",
\"password\": \"<Your_Password>\"

}");
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/get-usertoken")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var myHeaders = new Headers();

var raw = JSON.stringify({
"email": "<Your_Email>",
"password": "<Your_Password>"
});

var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/get-usertoken", requestOptions)
package main

import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/get-usertoken"
method := "POST"

payload := strings.NewReader(`{
"email": "<Your_Email>",
"password": "<Your_Password>"
}`)

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}

res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/get-usertoken");
var content = new StringContent("{
\"email\": \"<Your_Email>\",
\"password\": \"<Your_Password>\"
}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
"success": true,
"message": "User Token Fetched",
"user_id": 1,
"email": "test@gmail.com",
"user_token": "Your_UserToken",
"teams": "[]",
}

User List Copied!

All Users API allows retrieving a list of users. Users can be identified by their unique user ID, email, username, first name, and last name. The request is made in JSON format with user details, and the server responds with a JSON array containing user information. A successful response returns a status of “success” along with an array of user objects, including user ID, email, username, first name, and last name. This API serves as a fundamental tool for obtaining comprehensive user lists with minimal payload, aiding in user management and system integration.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
POST /api/user/list
curl --location 'https://your_domain.testgrid.io/api/user/list' \
--form 'user_token="<Your_User_Token>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/user/list")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/user/list"

payload = {'user_token': '<Your_User_Token>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/user/list');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/user/list")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/user/list", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/user/list"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/user/list");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
    "success": true,
    "message": "All user list",
    "data": {
        "user_id": 1,
        "parent_id": 1,
        "email": "test@gmail.com",
        "username": "TestGrid A",
        "first_name": "TestGrid",
        "last_name": "Admin",
        "teams": []
    }
}

Authentication Log Copied!

Get Authentication Logs

The get authentication log API allows users to retrieve login/logout activity for a given user. You can filter logs by user_id, date, and/or action.
Each parameter is optional, but if you include action or user_id, the date parameters must be provided.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
user_id text
The unique TestGrid User ID.
date text
The date in YYYY-MM-DD format to filter logs.
action text
The authentication action to filter by. Supported values: login, logout.
Languages Box
cURL cURL
Ruby Ruby
Python Python
PHP PHP
Java Java
Node.js Node.js
Go Go
.NET .NET
POST /api/authentication-log
curl --location 'https://your_domain.testgrid.io/api/authentication-log' \
--form 'user_token="<Your_User_Token>"' \
--form 'action="login"' \
--form 'user_id="<Your_User_ID> "' \
--form 'date=" {E.g: 2025-10-02 (YYYY-MM-DD)} "'
require 'net/http'
require 'uri'

uri = URI.parse('https://your_domain.testgrid.io/api/authentication-log')

request = Net::HTTP::Post.new(uri)
request.set_form(
{
"user_token" => "<Your_User_Token>",
"action" => "login",
"user_id" => "<Your_User_ID>",
"date" => "{E.g: 2025-10-02 (YYYY-MM-DD)}"
},
'multipart/form-data'
)

response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
http.request(request)
end

puts response.body
import requests

url = "https://your_domain.testgrid.io/api/authentication-log"

payload = {
"user_token": "<Your_User_Token>",
"action": "login",
"user_id": "<Your_User_ID>",
"date": "{E.g: 2025-10-02 (YYYY-MM-DD)}"
}

response = requests.post(url, files=payload)

print(response.text)
<?php

$url = 'https://your_domain.testgrid.io/api/authentication-log';

$postFields = [
'user_token' => '<Your_User_Token>',
'action' => 'login',
'user_id' => '<Your_User_ID>',
'date' => '{E.g: 2025-10-02 (YYYY-MM-DD)}',
];

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postFields);

$response = curl_exec($ch);

if (curl_errno($ch)) {
echo 'cURL Error: ' . curl_error($ch);
}

curl_close($ch);

echo $response;
OkHttpClient client = new OkHttpClient.Builder()
.build();

RequestBody body = new MultipartBody.Builder()
.setType(MultipartBody.FORM)
.addFormDataPart("user_token", "<Your_User_Token>")
.addFormDataPart("action", "login")
.addFormDataPart("user_id", "<Your_User_ID>")
.addFormDataPart("date", "{E.g: 2025-10-02 (YYYY-MM-DD)}")
.build();

Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/authentication-log")
.post(body)
.build();

Response response = client.newCall(request).execute();

System.out.println(response.body().string());
const formData = new FormData();
formData.append("user_token", "<Your_User_Token>");
formData.append("action", "login");
formData.append("user_id", "<Your_User_ID>");
formData.append("date", "{E.g: 2025-10-02 (YYYY-MM-DD)}");

fetch("https://your_domain.testgrid.io/api/authentication-log", {
method: "POST",
body: formData
})
.then(response => response.json())
.then(result => console.log(result))
.catch(error => console.error("Error:", error));
package main

import (
"bytes"
"fmt"
"mime/multipart"
"net/http"
)

func main() {

url := "https://your_domain.testgrid.io/api/authentication-log"

var buffer bytes.Buffer
writer := multipart.NewWriter(&buffer)

_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("action", "login")
_ = writer.WriteField("user_id", "<Your_User_ID>")
_ = writer.WriteField("date", "{E.g: 2025-10-02 (YYYY-MM-DD)}")

writer.Close()

req, err := http.NewRequest("POST", url, &buffer)
if err != nil {
panic(err)
}

req.Header.Set("Content-Type", writer.FormDataContentType())

client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()

fmt.Println("Status:", resp.Status)
}
const formData = new FormData();
formData.append("user_token", "<Your_User_Token>");
formData.append("action", "login");
formData.append("user_id", "<Your_User_ID>");
formData.append("date", "{E.g: 2025-10-02 (YYYY-MM-DD)}");

fetch("https://your_domain.testgrid.io/api/authentication-log", {
method: "POST",
body: formData
})
.then(res => res.json())
.then(data => console.log(data))
.catch(err => console.error(err));
Response
{
"success": true,
"data": [ {
"action": "logout",
"user_id": "1",
"email": "test@gmail.com",
"time_stamp": "2025-10-02 16:33:17"
}
{
"action": "logout",
"user_id": "1",
"email": "test@gmail.com",
"time_stamp": "2025-10-02 16:57:48"
}
{
"action": "logout",
"user_id": "1",
"email": "test@gmail.com",
"time_stamp": "2025-10-02 20:12:49"
}
]
}

Create user Copied!

Create user API facilitates user creation with a multipart/form-data request. The CURL command includes essential user details such as a user token, first name, last name, email, and password. Upon successful execution, the server responds with a JSON object confirming the creation status and providing user-specific information, like the newly assigned user ID.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
firstname string Required
Put user first name.
lastname string Required
Put user last name
email string Required
Put user email address.
password string Required
Put user password.
role string
(optional & default is : Team User) [Cloud Admin, Team Admin, Team User]
POST /api/user/create
curl --location 'https://your_domain.testgrid.io/api/user/create' \
--form 'user_token="<Your_User_Token>"' \
--form 'firstname="<Your_First_Name>"' \
--form 'lastname="<Your_Last_Name>"' \
--form 'email="<Your_Email>"' \
--form 'password="<Your_Password>"' \
--form 'role="<User_Role>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/user/create")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>'],['firstname', '<Your_First_Name>'],['lastname', '<Your_Last_Name>'],['email', '<Your_Email>'],['password', '<Your_Password>'],['role', '<User_Role>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/user/create"

payload = {'user_token': '<Your_User_Token>',
'firstname': '<Your_First_Name>',
'lastname': '<Your_Last_Name>',
'email': '<Your_Email>',
'password': '<Your_Password>',
'role': '<User_Role>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
],
[
'name' => 'firstname',
'contents' => '<Your_First_Name>'
],
[
'name' => 'lastname',
'contents' => '<Your_Last_Name>'
],
[
'name' => 'email',
'contents' => '<Your_Email>'
],
[
'name' => 'password',
'contents' => '<Your_Password>'
],
[
'name' => 'role',
'contents' => '<User_Role>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/user/create');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.addFormDataPart("firstname","<Your_First_Name>")
.addFormDataPart("lastname","<Your_Last_Name>")
.addFormDataPart("email","<Your_Email>")
.addFormDataPart("password","<Your_Password>")
.addFormDataPart("role","<User_Role>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/user/create")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");
formdata.append("firstname", "<Your_First_Name>");
formdata.append("lastname", "<Your_Last_Name>");
formdata.append("email", "<Your_Email>");
formdata.append("password", "<Your_Password>");
formdata.append("role", "<User_Role>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/user/create", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/user/create"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("firstname", "<Your_First_Name>")
_ = writer.WriteField("lastname", "<Your_Last_Name>")
_ = writer.WriteField("email", "<Your_Email>")
_ = writer.WriteField("password", "<Your_Password>")
_ = writer.WriteField("role", "<User_Role>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/user/create");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
content.Add(new StringContent("<Your_First_Name>"), "firstname");
content.Add(new StringContent("<Your_Last_Name>"), "lastname");
content.Add(new StringContent("<Your_Email>"), "email");
content.Add(new StringContent("<Your_Password>"), "password");
content.Add(new StringContent("<User_Role>"), "role");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
"success": true,
"user_id": "1"
"message": "User updated successfully."
}

Update user Copied!

Update user API facilitates user updates, allowing modifications to user details. The CURL command, utilizing form data, includes a user token, and fields for updating the user’s first name, last name, and password. The server responds with a JSON object indicating the update status.

Path Parameters

{user_id} string Required
Provide the user id of the user that you like to update. You can get the User ID of any user from All User API

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
firstname string
Put user first name(which needs to be updated).
lastname string
Put user last name(which needs to be updated)
password string
Put user password(which needs to be updated)
POST /api/user/update/{{user_id}}/
curl --location --globoff 'https://your_domain.testgrid.io/api/user/update/{{user_id}}/' \
--form 'user_token="<Your_User_Token>"' \
--form 'firstname="<Your_First_Name>"' \
--form 'lastname="<Your_Last_Name>"' \
--form 'password="<Your_Password>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/user/update/{{user_id}}/")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>'],['firstname', '<Your_First_Name>'],['lastname', '<Your_Last_Name>'],['password', '<Your_Password>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/user/update/{{user_id}}/"

payload = {'user_token': '<Your_User_Token>',
'firstname': '<Your_First_Name>',
'lastname': '<Your_Last_Name>',
'password': '<Your_Password>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
],
[
'name' => 'firstname',
'contents' => '<Your_First_Name>'
],
[
'name' => 'lastname',
'contents' => '<Your_Last_Name>'
],
[
'name' => 'password',
'contents' => '<Your_Password>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/user/update/{{user_id}}/');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.addFormDataPart("firstname","<Your_First_Name>")
.addFormDataPart("lastname","<Your_Last_Name>")
.addFormDataPart("password","<Your_Password>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/user/update/{{user_id}}/")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");
formdata.append("firstname", "<Your_First_Name>");
formdata.append("lastname", "<Your_Last_Name>");
formdata.append("password", "<Your_Password>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/user/update/{{user_id}}/", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/user/update/{{user_id}}/"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("firstname", "<Your_First_Name>")
_ = writer.WriteField("lastname", "<Your_Last_Name>")
_ = writer.WriteField("password", "<Your_Password>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/user/update/{{user_id}}/");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
content.Add(new StringContent("<Your_First_Name>"), "firstname");
content.Add(new StringContent("<Your_Last_Name>"), "lastname");
content.Add(new StringContent("<Your_Password>"), "password");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
    "success": true,
    "message": "User updated successfully."
}

Delete user Copied!

The Delete user API endpoint facilitates user deletion, removing a user from the TestGrid. The CURL command, utilizing form data, includes a user token to authenticate the deletion request. Upon successful execution, the server responds with a JSON object indicating the deletion status.

Path Parameters

{user_id} string Required
Provide the user id of the user that you like to delete. You can get the User ID of any user from All User API

Body Parameters

user_token string Required
POST /api/user/delete/{{user_id}}/
curl --location --globoff 'https://your_domain.testgrid.io/api/user/delete/{{user_id}}/' \
--form 'user_token="<Your_User_Token>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/user/delete/{{user_id}}/")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/user/delete/{{user_id}}/"

payload = {'user_token': '<Your_User_Token>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/user/delete/{{user_id}}/');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/user/delete/{{user_id}}/")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/user/delete/{{user_id}}/", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/user/delete/{{user_id}}/"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/user/delete/{{user_id}}/");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
    "success": true,
    "message": "User deleted successfully."
}

Add device Copied!

Adding or Assigning devices to any specific user account in TestGrid.

Path Parameters

{user_id} string Required
Provide the user id of the user that you like to assign the device. You can get the User ID of any user from All User API

Body Parameters

user_token string Required
Here usertoken of user who will get the device. Please refer this link to find the usertoken: https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/
device_id string Required
Get all devices api will give you the device_id
POST /api/user/adddevice/{{user_id}}/
curl --location --globoff 'https://your_domain.testgrid.io/api/user/adddevice/{{user_id}}/' \
--form 'user_token="<Your_User_Token>"' \
--form 'device_id="<Your_Device_id>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/user/adddevice/{{user_id}}/")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>'],['device_id', '<Your_Device_id>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/user/adddevice/{{user_id}}/"

payload = {'user_token': '<Your_User_Token>',
'device_id': '<Your_Device_id>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
],
[
'name' => 'device_id',
'contents' => '<Your_Device_id>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/user/adddevice/{{user_id}}/');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.addFormDataPart("device_id","<Your_Device_id>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/user/adddevice/{{user_id}}/")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");
formdata.append("device_id", "<Your_Device_id>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/user/adddevice/{{user_id}}/", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/user/adddevice/{{user_id}}/"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("device_id", "<Your_Device_id>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/user/adddevice/{{user_id}}/");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
content.Add(new StringContent("<Your_Device_id>"), "device_id");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
    "success": true,
    "message": "Device added successfully."
}

Remove device Copied!

The Remove Device section allows users to remove a specific device associated with their account user. By providing the user ID, user token, and device ID, users can easily remove unwanted devices from their account for enhanced security and device management.

Path Parameters

{user_id} string Required
Provide the user id of the user that you like to remove the device. You can get the User ID of any user from All User API

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
device_id string Required
The device_id of the device which you want to remove from User's account.
POST /api/user/removedevice/{{user_id}}/
curl --location --globoff 'https://your_domain.testgrid.io/api/user/removedevice/{{user_id}}/' \
--form 'user_token="<Your_User_Token>"' \
--form 'device_id="<Your_device_id>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/user/removedevice/{{user_id}}/")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>'],['device_id', '<Your_device_id>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/user/removedevice/{{user_id}}/"

payload = {'user_token': '<Your_User_Token>',
'device_id': '<Your_device_id>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
],
[
'name' => 'device_id',
'contents' => '<Your_device_id>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/user/removedevice/{{user_id}}/');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.addFormDataPart("device_id","<Your_device_id>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/user/removedevice/{{user_id}}/")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");
formdata.append("device_id", "<Your_device_id>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/user/removedevice/{{user_id}}/", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/user/removedevice/{{user_id}}/"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("device_id", "<Your_device_id>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/user/removedevice/{{user_id}}/");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
content.Add(new StringContent("<Your_device_id>"), "device_id");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
    "success": true,
    "message": "Device removed successfully"
}

Team Copied!

The Team section allows users to access information about the teams associated with their projects. This section enables users to view team members, roles, and related data, providing essential insights into project collaboration and management. With the Team section, users can efficiently organize and coordinate their project teams for optimal performance and productivity.

Team list Copied!

The Team List section allows users to retrieve a list of teams associated with a user’s account. Users can use this feature to easily view and manage the teams they are a part of within the TestGrid. This section provides a convenient way to access team information for better organization and collaboration.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
POST /api/user/teamlist/
curl --location 'https://your_domain.testgrid.io/api/user/teamlist/' \
--form 'user_token="<Your_User_Token>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/user/teamlist/")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/user/teamlist/"

payload = {'user_token': '<Your_User_Token>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/user/teamlist/');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/user/teamlist/")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/user/teamlist/", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/user/teamlist/"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/user/teamlist/");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
"success": true,
"message": "All team list",
"data": [ {
"id": "1",
"user_id": "2"
"team_name": "QA_Team"
"description": "QA team"
"status": "1"
"is_default": "1"
"created_at": "2025-04-17 07:35:21"
},
{
"id": "3",
"user_id": "2"
"team_name": "newTeam"
"description": "new team"
"status": "1"
"is_default": "0"
"created_at": "2025-06-05 11:35:27"
},
{
"id": "6",
"user_id": "2"
"team_name": "Testing Team1"
"description": "Testing Team1"
"status": "1"
"is_default": "0"
"created_at": "2025-08-26 11:23:24"
},
{
"id": "15",
"user_id": "2"
"team_name": "Testing Team"
"description": "This is for demo purpose"
"status": "1"
"is_default": "0"
"created_at": "026-01-16 11:17:27"
}
]
}

Create team Copied!

The Create Team section allows users to generate a new team within the TestGrid. By providing essential details such as the team’s name and description, users can effectively set up a team for collaborative work. Additionally, users can specify the team’s status, whether active or inactive, to manage team visibility and participation.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
team_name text Required
The name of the team being created.
team_description text Required
The description of the team being created.
status text
Status of the team being created. Use 0 for deactivated teams and 1 for activated teams.
POST /api/user/createteam/
curl --location 'https://your_domain.testgrid.io/api/user/createteam/' \
--form 'user_token="<Your_User_Token>"' \
--form 'team_name="<Your_Team_Name>"' \
--form 'team_description="<Your_Team_Description>"' \
--form 'status="1"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/user/createteam/")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>'],['team_name', '<Your_Team_Name>'],['team_description', '<Your_Team_Description>'],['status', '1']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/user/createteam/"

payload = {'user_token': '<Your_User_Token>',
'team_name': '<Your_Team_Name>',
'team_description': '<Your_Team_Description>',
'status': '1'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
],
[
'name' => 'team_name',
'contents' => '<Your_Team_Name>'
],
[
'name' => 'team_description',
'contents' => '<Your_Team_Description>'
],
[
'name' => 'status',
'contents' => '1'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/user/createteam/');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.addFormDataPart("team_name","<Your_Team_Name>")
.addFormDataPart("team_description","<Your_Team_Description>")
.addFormDataPart("status","1")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/user/createteam/")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");
formdata.append("team_name", "<Your_Team_Name>");
formdata.append("team_description", "<Your_Team_Description>");
formdata.append("status", "1");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/user/createteam/", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/user/createteam/"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("team_name", "<Your_Team_Name>")
_ = writer.WriteField("team_description", "<Your_Team_Description>")
_ = writer.WriteField("status", "1")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/user/createteam/");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
content.Add(new StringContent("<Your_Team_Name>"), "team_name");
content.Add(new StringContent("<Your_Team_Description>"), "team_description");
content.Add(new StringContent("1"), "status");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
    "success": true,
    "team_id": 16,
    "message": "Team created successfully."
}

Update team Copied!

The “Update team” API enables users to modify team information within the TestGrid. By updating team details such as name, description, and status, users can effectively manage their team configurations. This functionality allows for seamless customization and organization of team data within the platform.

Body Parameters

user_token text Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
team_id text Required
Unique identifier for the team being updated.
team_name text Required
Name of the team being updated.
team_description text
Description of the team being updated.
status text Required
Status of the team (0=deactivated, 1=activated).
POST /api/user/updateteam/
curl --location 'https://your_domain.testgrid.io/api/user/updateteam/' \
--form 'user_token="<Your_User_Token>"' \
--form 'team_id="<Your_Team_Id>"' \
--form 'team_name="<Your_Team_Name>"' \
--form 'team_description="<Your_Team_Description>"' \
--form 'status="1"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/user/updateteam/")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>'],['team_id', '<Your_Team_Id>'],['team_name', '<Your_Team_Name>'],['team_description', '<Your_Team_Description>'],['status', '1']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/user/updateteam/"

payload = {'user_token': '<Your_User_Token>',
'team_id': '<Your_Team_Id>',
'team_name': '<Your_Team_Name>',
'team_description': '<Your_Team_Description>',
'status': '1'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
],
[
'name' => 'team_id',
'contents' => '<Your_Team_Id>'
],
[
'name' => 'team_name',
'contents' => '<Your_Team_Name>'
],
[
'name' => 'team_description',
'contents' => '<Your_Team_Description>'
],
[
'name' => 'status',
'contents' => '1'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/user/updateteam/');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.addFormDataPart("team_id","<Your_Team_Id>")
.addFormDataPart("team_name","<Your_Team_Name>")
.addFormDataPart("team_description","<Your_Team_Description>")
.addFormDataPart("status","1")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/user/updateteam/")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");
formdata.append("team_id", "<Your_Team_Id>");
formdata.append("team_name", "<Your_Team_Name>");
formdata.append("team_description", "<Your_Team_Description>");
formdata.append("status", "1");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/user/updateteam/", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/user/updateteam/"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("team_id", "<Your_Team_Id>")
_ = writer.WriteField("team_name", "<Your_Team_Name>")
_ = writer.WriteField("team_description", "<Your_Team_Description>")
_ = writer.WriteField("status", "1")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/user/updateteam/");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
content.Add(new StringContent("<Your_Team_Id>"), "team_id");
content.Add(new StringContent("<Your_Team_Name>"), "team_name");
content.Add(new StringContent("<Your_Team_Description>"), "team_description");
content.Add(new StringContent("1"), "status");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
    "success": true,
    "team_id": 16,
    "message": "Team updated successfully."
}

Delete team Copied!

The Delete Team section allows users to remove a team from the TesGrid. By utilizing this functionality, users can easily manage their team configurations within the platform. This section streamlines the process of team maintenance and organization, enhancing the overall project management experience for users.

Body Parameters

user_token text Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
team_id text Required
The unique identifier of the team to be deleted.
POST /api/user/deleteteam/
curl --location 'https://your_domain.testgrid.io/api/user/deleteteam/' \
--form 'user_token="<Your_User_Token>"' \
--form 'team_id="<Your_Team_Id>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/user/deleteteam/")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>'],['team_id', '<Your_Team_Id>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/user/deleteteam/"

payload = {'user_token': '<Your_User_Token>',
'team_id': '<Your_Team_Id>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
],
[
'name' => 'team_id',
'contents' => '<Your_Team_Id>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/user/deleteteam/');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.addFormDataPart("team_id","<Your_Team_Id>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/user/deleteteam/")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");
formdata.append("team_id", "<Your_Team_Id>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/user/deleteteam/", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/user/deleteteam/"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("team_id", "<Your_Team_Id>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/user/deleteteam/");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
content.Add(new StringContent("<Your_Team_Id>"), "team_id");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
    "success": true,
    "team_id": 16,
    "message": "Team deleted successfully."
}

Assign team admin Copied!

The Assign team admin section allows users to designate a team administrator within the TestGrid. By assigning or removing team admin privileges, users can efficiently manage team permissions and responsibilities. This section streamlines the process of organizing team roles and optimizing project collaboration.

Body Parameters

user_token text Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
team_id text Required
The unique identifier of the team to which the user will be assigned as an admin.
user_id text
The unique identifier of the user who will be assigned as the admin of the specified team.
status text
Indicates the action to be taken. Use 0 to remove the user from the admin role or 1 to assign the user as an admin.
POST /api/user/assignteamadmin/
curl --location 'https://your_domain.testgrid.io/api/user/assignteamadmin/' \
--form 'user_token="<Your_User_Token>"' \
--form 'team_id="<Your_Team_Id>"' \
--form 'user_id="<Your_User_Id>"' \
--form 'status="0"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/user/assignteamadmin/")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>'],['team_id', '<Your_Team_Id>'],['user_id', '<Your_User_Id>'],['status', '0']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/user/assignteamadmin/"

payload = {'user_token': '<Your_User_Token>',
'team_id': '<Your_Team_Id>',
'user_id': '<Your_User_Id>',
'status': '0'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
],
[
'name' => 'team_id',
'contents' => '<Your_Team_Id>'
],
[
'name' => 'user_id',
'contents' => '<Your_User_Id>'
],
[
'name' => 'status',
'contents' => '0'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/user/assignteamadmin/');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.addFormDataPart("team_id","<Your_Team_Id>")
.addFormDataPart("user_id","<Your_User_Id>")
.addFormDataPart("status","0")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/user/assignteamadmin/")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");
formdata.append("team_id", "<Your_Team_Id>");
formdata.append("user_id", "<Your_User_Id>");
formdata.append("status", "0");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/user/assignteamadmin/", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/user/assignteamadmin/"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("team_id", "<Your_Team_Id>")
_ = writer.WriteField("user_id", "<Your_User_Id>")
_ = writer.WriteField("status", "0")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/user/assignteamadmin/");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
content.Add(new StringContent("<Your_Team_Id>"), "team_id");
content.Add(new StringContent("<Your_User_Id>"), "user_id");
content.Add(new StringContent("0"), "status");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
status
1
{
"success": true,
"message": "Team admin assigned successfully."
}

status
0
{
"success": true,
"message": "Team admin removed successfully."
}

Assign user to team Copied!

The “Assign user to team” section allows admin users to assign a specific user to a team within the TestGrid. By specifying the user’s authentication token, the team’s unique identifier, the user’s identifier, and the desired status, users can efficiently manage team membership and access permissions within the platform. This functionality streamlines team collaboration and access control, enhancing project organization and efficiency.

Body Parameters

user_token text Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
team_id string Required
The unique identifier of the team to which the user will be assigned.
user_id string Required
The unique identifier of the user who will be assigned to the specified team.
status string Required
Indicates whether to remove (0) or assign (1) the user to the team.
POST /api/user/assignteamuser/
curl --location 'https://your_domain.testgrid.io/api/user/assignteamuser/' \
--form 'user_token="<Your_User_Token>"' \
--form 'team_id="<Your_Team_Id>"' \
--form 'user_id="<Your_User_Id>"' \
--form 'status="1"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/user/assignteamuser/")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>'],['team_id', '<Your_Team_Id>'],['user_id', '<Your_User_Id>'],['status', '1']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/user/assignteamuser/"

payload = {'user_token': '<Your_User_Token>',
'team_id': '<Your_Team_Id>',
'user_id': '<Your_User_Id>',
'status': '1'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
],
[
'name' => 'team_id',
'contents' => '<Your_Team_Id>'
],
[
'name' => 'user_id',
'contents' => '<Your_User_Id>'
],
[
'name' => 'status',
'contents' => '1'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/user/assignteamuser/');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.addFormDataPart("team_id","<Your_Team_Id>")
.addFormDataPart("user_id","<Your_User_Id>")
.addFormDataPart("status","1")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/user/assignteamuser/")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");
formdata.append("team_id", "<Your_Team_Id>");
formdata.append("user_id", "<Your_User_Id>");
formdata.append("status", "1");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/user/assignteamuser/", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/user/assignteamuser/"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("team_id", "<Your_Team_Id>")
_ = writer.WriteField("user_id", "<Your_User_Id>")
_ = writer.WriteField("status", "1")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/user/assignteamuser/");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
content.Add(new StringContent("<Your_Team_Id>"), "team_id");
content.Add(new StringContent("<Your_User_Id>"), "user_id");
content.Add(new StringContent("1"), "status");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
status
1
{
"success": true,
"message": "Team user assigned successfully."
}

status
0
{
"success": false,
"message": "Team user removed successfully."
}

Device Group Copied!

The Device Group section allows users to efficiently manage and organize devices into logical groups. With this feature, users can easily group related devices together for streamlined management and organization. This section provides functionality to create, update, and delete device groups, as well as retrieve information about existing groups.

Languages Box
cURL cURL
Ruby Ruby
Python Python
PHP PHP
Java Java
Node.js Node.js
Go Go
.NET .NET

Get device groups Copied!

This section allows users to retrieve device groups associated with a TestGrid. By using this functionality, users can efficiently organize and manage devices within designated groups. This feature provides a streamlined way to access and categorize devices for enhanced user experience and organization.

Body Parameters

user_token text Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
POST /api/user/devicegroups/
curl --location 'https://your_domain.testgrid.io/api/user/devicegroups/' \
--form 'user_token="<Your_User_Token>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/user/devicegroups/")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/user/devicegroups/"

payload = {'user_token': '<Your_User_Token>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/user/devicegroups/');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/user/devicegroups/")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/user/devicegroups/", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/user/devicegroups/"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/user/devicegroups/");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
    "success": true,
    "message": "All device group list",
    "data": [
        {
            "id": "1",
            "user_id": "2",
            "group_name": "QA_DeviceGroup",
            "is_default": "1",
            "created": "2025-04-17 07:35:36",
            "teams": [
                {
                    "id": "1",
                    "team_name": "QA_Team"
                },
                {
                    "id": "6",
                    "team_name": "QA_Team2"
                }
            ]
        },
        {
            "id": "3",
            "user_id": "2",
            "group_name": "iOS",
            "is_default": "0",
            "created": "2025-05-13 14:25:20",
            "teams": [
                {
                    "id": "3",
                    "team_name": "newTeam"
                },
                {
                    "id": "6",
                    "team_name": "newTeam2"
                }
            ]
        }
    ]
}

Create device group Copied!

The Create device group API allows users to easily create a new device group within the TestGrid. By providing the necessary parameters, users can efficiently organize and manage their devices within distinct groups.

Body Parameters

user_token text Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
group_name text Required
The name of the device group being created by the user.
POST /api/user/createdevicegroup/
curl --location 'https://your_domain.testgrid.io/api/user/createdevicegroup/' \
--form 'user_token="<Your_User_Token>"' \
--form 'group_name="<Your_Group_Name>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/user/createdevicegroup/")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>'],['group_name', '<Your_Group_Name>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/user/createdevicegroup/"

payload = {'user_token': '<Your_User_Token>',
'group_name': '<Your_Group_Name>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
],
[
'name' => 'group_name',
'contents' => '<Your_Group_Name>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/user/createdevicegroup/');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.addFormDataPart("group_name","<Your_Group_Name>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/user/createdevicegroup/")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");
formdata.append("group_name", "<Your_Group_Name>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/user/createdevicegroup/", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/user/createdevicegroup/"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("group_name", "<Your_Group_Name>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/user/createdevicegroup/");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
content.Add(new StringContent("<Your_Group_Name>"), "group_name");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
    "success": true,
    "group_id": 10,
    "message": "Device group created successfully."
}

Update device group Copied!

This API allows users to update the device group name. By making use of this functionality, users can conveniently manage and modify device group assignments for improved user organization and access control within TestGrid.

Body Parameters

user_token text Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
group_id text Required
The unique identifier of the device group that needs to be updated.
group_name text Required
The name of the device group that needs to be updated.
POST /api/user/updatedevicegroup/
curl --location 'https://your_domain.testgrid.io/api/user/updatedevicegroup/' \
--form 'user_token="<Your_User_Token>"' \
--form 'group_id="<Your_Device_Group_Id>"' \
--form 'group_name="<Your_Device_Group_Name>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/user/updatedevicegroup/")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>'],['group_id', '<Your_Device_Group_Id>'],['group_name', '<Your_Device_Group_Name>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/user/updatedevicegroup/"

payload = {'user_token': '<Your_User_Token>',
'group_id': '<Your_Device_Group_Id>',
'group_name': '<Your_Device_Group_Name>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
],
[
'name' => 'group_id',
'contents' => '<Your_Device_Group_Id>'
],
[
'name' => 'group_name',
'contents' => '<Your_Device_Group_Name>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/user/updatedevicegroup/');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.addFormDataPart("group_id","<Your_Device_Group_Id>")
.addFormDataPart("group_name","<Your_Device_Group_Name>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/user/updatedevicegroup/")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");
formdata.append("group_id", "<Your_Device_Group_Id>");
formdata.append("group_name", "<Your_Device_Group_Name>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/user/updatedevicegroup/", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/user/updatedevicegroup/"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("group_id", "<Your_Device_Group_Id>")
_ = writer.WriteField("group_name", "<Your_Device_Group_Name>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/user/updatedevicegroup/");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
content.Add(new StringContent("<Your_Device_Group_Id>"), "group_id");
content.Add(new StringContent("<Your_Device_Group_Name>"), "group_name");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
    "success": true,
    "group_id": 10,
    "message": "Device group updated successfully."
}

Delete device group Copied!

The “Delete device group” API allows users to remove a device group from their account. By using this functionality, users can effectively manage their device groups and streamline their organization within the TestGrid. This action helps users declutter their account and ensure accurate tracking and management of their devices.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
group_id text Required
The ID of the device group to be deleted.
POST /api/user/deletedevicegroup/
curl --location 'https://your_domain.testgrid.io/api/user/deletedevicegroup/' \
--form 'user_token="<Your_User_Token>"' \
--form 'group_id="<Your_Device_Group_Id>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/user/deletedevicegroup/")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>'],['group_id', '<Your_Device_Group_Id>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/user/deletedevicegroup/"

payload = {'user_token': '<Your_User_Token>',
'group_id': '<Your_Device_Group_Id>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
],
[
'name' => 'group_id',
'contents' => '<Your_Device_Group_Id>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/user/deletedevicegroup/');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.addFormDataPart("group_id","<Your_Device_Group_Id>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/user/deletedevicegroup/")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");
formdata.append("group_id", "<Your_Device_Group_Id>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/user/deletedevicegroup/", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/user/deletedevicegroup/"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("group_id", "<Your_Device_Group_Id>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/user/deletedevicegroup/");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
content.Add(new StringContent("<Your_Device_Group_Id>"), "group_id");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
    "success": true,
    "group_id": 10,
    "message": "Device group deleted successfully."
}

Assign device to group Copied!

The “Assign device to group” API allows users to manage device-group relationships within the TestGrid. Users can assign or remove devices from specific groups using the provided parameters. This functionality streamlines the organization and grouping of devices for efficient management and monitoring.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
group_id text Required
The ID of the group to which the device will be assigned.
device_id text Required
The ID of the device to be assigned to the specified group.
status text Required
Indicates the action to be taken on the device. Use 0 to remove the device from the group, and 1 to assign the device to the group.
POST /api/user/assigndevicetogroup/
curl --location 'https://your_domain.testgrid.io/api/user/assigndevicetogroup/' \
--form 'user_token="<Your_User_Token>"' \
--form 'group_id="<Your_Device_Group_Id>"' \
--form 'device_id="<Your_Device_Id>"' \
--form 'status="<Device_Assign_Status>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/user/assigndevicetogroup/")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>'],['group_id', '<Your_Device_Group_Id>'],['device_id', '<Your_Device_Id>'],['status', '<Device_Assign_Status>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/user/assigndevicetogroup/"

payload = {'user_token': '<Your_User_Token>',
'group_id': '<Your_Device_Group_Id>',
'device_id': '<Your_Device_Id>',
'status': '<Device_Assign_Status>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
],
[
'name' => 'group_id',
'contents' => '<Your_Device_Group_Id>'
],
[
'name' => 'device_id',
'contents' => '<Your_Device_Id>'
],
[
'name' => 'status',
'contents' => '<Device_Assign_Status>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/user/assigndevicetogroup/');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.addFormDataPart("group_id","<Your_Device_Group_Id>")
.addFormDataPart("device_id","<Your_Device_Id>")
.addFormDataPart("status","<Device_Assign_Status>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/user/assigndevicetogroup/")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");
formdata.append("group_id", "<Your_Device_Group_Id>");
formdata.append("device_id", "<Your_Device_Id>");
formdata.append("status", "<Device_Assign_Status>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/user/assigndevicetogroup/", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/user/assigndevicetogroup/"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("group_id", "<Your_Device_Group_Id>")
_ = writer.WriteField("device_id", "<Your_Device_Id>")
_ = writer.WriteField("status", "<Device_Assign_Status>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/user/assigndevicetogroup/");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
content.Add(new StringContent("<Your_Device_Group_Id>"), "group_id");
content.Add(new StringContent("<Your_Device_Id>"), "device_id");
content.Add(new StringContent("<Device_Assign_Status>"), "status");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
    "success": true,
    "group_id": "12",
    "message": "Device assigned to group successfully."
}

Assign device group to team Copied!

This API allows users to assign a device group to a specific team within the TestGrid. By linking device groups to teams, users can effectively manage and organize devices based on team assignments. This functionality enables seamless collaboration and streamlined device group management within the project.

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
team_id text Required
The ID of the team to which the device group will be assigned.
group_id text Required
The ID of the device group to be assigned to the team.
status text Required
Indicates the action to be taken on the device group. Use 0 to remove the device group or 1 to assign it.
POST /api/user/assigndevicegrouptoteam/
curl --location 'https://your_domain.testgrid.io/api/user/assigndevicegrouptoteam/' \
--form 'user_token="<Your_User_Token>"' \
--form 'team_id="<Your_Team_Id>"' \
--form 'group_id="<Your_Device_Group_Id>"' \
--form 'status="<Device_Assign_Status>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/user/assigndevicegrouptoteam/")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>'],['team_id', '<Your_Team_Id>'],['group_id', '<Your_Device_Group_Id>'],['status', '<Device_Assign_Status>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/user/assigndevicegrouptoteam/"

payload = {'user_token': '<Your_User_Token>',
'team_id': '<Your_Team_Id>',
'group_id': '<Your_Device_Group_Id>',
'status': '<Device_Assign_Status>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
],
[
'name' => 'team_id',
'contents' => '<Your_Team_Id>'
],
[
'name' => 'group_id',
'contents' => '<Your_Device_Group_Id>'
],
[
'name' => 'status',
'contents' => '<Device_Assign_Status>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/user/assigndevicegrouptoteam/');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.addFormDataPart("team_id","<Your_Team_Id>")
.addFormDataPart("group_id","<Your_Device_Group_Id>")
.addFormDataPart("status","<Device_Assign_Status>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/user/assigndevicegrouptoteam/")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");
formdata.append("team_id", "<Your_Team_Id>");
formdata.append("group_id", "<Your_Device_Group_Id>");
formdata.append("status", "<Device_Assign_Status>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/user/assigndevicegrouptoteam/", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/user/assigndevicegrouptoteam/"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("team_id", "<Your_Team_Id>")
_ = writer.WriteField("group_id", "<Your_Device_Group_Id>")
_ = writer.WriteField("status", "<Device_Assign_Status>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/user/assigndevicegrouptoteam/");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
content.Add(new StringContent("<Your_Team_Id>"), "team_id");
content.Add(new StringContent("<Your_Device_Group_Id>"), "group_id");
content.Add(new StringContent("<Device_Assign_Status>"), "status");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
    "success": true,
    "group_id": "12",
    "message": "Device group assigned to team successfully."
}

Group devices Copied!

This section allows users to retrieve device groups associated with a TestGrid. By using this functionality, users can efficiently organize and manage devices within designated groups. This feature provides a streamlined way to access and categorize devices for enhanced user experience and organization.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
POST /api/user/groupdevices/group_id
curl --location 'https://your_domain.testgrid.io/api/user/groupdevices/group_id' \
--form 'user_token="<Your_User_Token>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/user/groupdevices/group_id")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/user/groupdevices/group_id"

payload = {'user_token': '<Your_User_Token>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/user/groupdevices/group_id');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/user/groupdevices/group_id")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/user/groupdevices/group_id", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/user/groupdevices/group_id"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/user/groupdevices/group_id");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
"success": true,
"data":[ {
"device_id": "11",
"UDID": "xxx",
"tags": "",
"device_type": "3",
"platform_version": "15.6.1",
"device_name": "Safari-402",
"manufactured_by": "",
"s_device": "5F4M2C",
"wda_local_port": "",
"system_port": "",
"is_run_generator": "0",
"is_run_build": "0",
"is_run_local_execution": "0",
"is_run_virtual_usb": "0",
"is_run_device_cloud": "0",
"is_offline": "0",
"is_connected": "1",
"is_device_offline": "0",
"is_unauthorised": "0",
"is_rebooting": "0",
"is_reserved": "0",
"is_preparing": "0",
"is_cleaning": "0",
"reserved_device_user_email": "",
"appium_url": "https://your_domain.testgrid.io/appium_/wd/hub",
"platform_name": "Web",
"automation_name": "UiAutomator2",
}
]
"message": "Group device list.",
}

Build Copied!

The Build section of the TestGrid API allows users to retrieve information related to their runs and builds. With this sections, users can access details such as pass/fail test case information with failure reasons, Create applications, test suites, get application information, test suites/module version, and application version, and delete others. Get all related insights, transactions, and network logs using the TestGrid API.

Get Applications List Copied!

This section allows users to retrieve all applications associated with a user. By making use of the user’s token, users can easily access and view all submitted applications.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
POST /api/user/applications
curl --location 'https://your_domain.testgrid.io/api/user/applications' \
--form 'user_token="<Your_User_Token>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/user/applications")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/user/applications"

payload = {'user_token': '<Your_User_Token>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/user/applications');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/user/applications")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/user/applications", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/user/applications"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/user/applications");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
    "success": true,
    "message": "All Build list",
    "data": [
        {
            "app_id": "{Your_app_id}",
            "name": "{Your_Application_Name}",
            "application_token": "xxxxxxxxxxx",
            "cm_version_id": "1,470,472,473"
        },
        {
            "app_id": "{Your_app_id}",
            "name": "{Your_Application_Name}",
            "application_token": "xxxxxxxxxxx",
            "cm_version_id": "1,457,465,466,467,477"
        }
    ]
}

Create Application Copied!

The Create application API allows users to create a new test application within the TestGrid. By providing necessary information such as the user token, application name, version name, and platform type, users can easily add a new test application on TestGrid

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
version_name string Required
Version name that need to be created.
application_name string Required
The name of the application to create.
platform_type string Required
ios, android, web (required).
POST /api/create-application
curl --location 'https://your_domain.testgrid.io/api/create-application' \
--form 'user_token="<Your_User_Token>"' \
--form 'version_name="<Your_Version_Name>"' \
--form 'application_name="<Your_Application_Name>"' \
--form 'platform_type="<Your_Version_Platform_Type>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/create-application")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>'],['version_name', '<Your_Version_Name>'],['application_name', '<Your_Application_Name>'],['platform_type', '<Your_Version_Platform_Type>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/create-application"

payload = {'user_token': '<Your_User_Token>',
'version_name': '<Your_Version_Name>',
'application_name': '<Your_Application_Name>',
'platform_type': '<Your_Version_Platform_Type>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
],
[
'name' => 'version_name',
'contents' => '<Your_Version_Name>'
],
[
'name' => 'application_name',
'contents' => '<Your_Application_Name>'
],
[
'name' => 'platform_type',
'contents' => '<Your_Version_Platform_Type>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/create-application');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.addFormDataPart("version_name","<Your_Version_Name>")
.addFormDataPart("application_name","<Your_Application_Name>")
.addFormDataPart("platform_type","<Your_Version_Platform_Type>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/create-application")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");
formdata.append("version_name", "<Your_Version_Name>");
formdata.append("application_name", "<Your_Application_Name>");
formdata.append("platform_type", "<Your_Version_Platform_Type>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/create-application", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/create-application"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("version_name", "<Your_Version_Name>")
_ = writer.WriteField("application_name", "<Your_Application_Name>")
_ = writer.WriteField("platform_type", "<Your_Version_Platform_Type>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/create-application");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
content.Add(new StringContent("<Your_Version_Name>"), "version_name");
content.Add(new StringContent("<Your_Application_Name>"), "application_name");
content.Add(new StringContent("<Your_Version_Platform_Type>"), "platform_type");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
"success": true,
"response": {
"app_id": "223",
"application_name": "NewTestAPIApplication",
"application_token": "xxxxxxxxxxx",
"application_version_name": "1",
"application_version_description": "",
"application_version_token": "xxxxxxxxxxx",
"application_platform_type": "Android"
},
"message": "Application Created Successfully.",
}

Create Version Copied!

The “Create Version” API allows users to generate a new version within the TestGrid Application. By providing essential details such as the version name, platform, and optional description, users can seamlessly add a new version to their project. Upon successful creation, users will receive pertinent information about the newly generated version.

Path Parameters

{app_id} string Required
The unique identifier for the application.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
version_name text Required
(required) The name of the version being created.
version_description text
(optional) A description of the version being created.
version_platform text Required
(required) The platform for which the version is being created - can be ios, android, or web.
Languages Box
cURL cURL
Ruby Ruby
Python Python
PHP PHP
Java Java
Node.js Node.js
Go Go
.NET .NET
POST /api/user/version/{{app_id}}/
curl --location --globoff 'https://your_domain.testgrid.io/api/user/version/{{app_id}}/' \
--form 'user_token="<Your_User_Token>"' \
--form 'version_name="<Your_Version_Name>"' \
--form 'version_description="<Your_Version_Description>"' \
--form 'version_platform="<Your_Version_Platform_Type>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/user/version/{{app_id}}/")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>'],['version_name', '<Your_Version_Name>'],['version_description', '<Your_Version_Description>'],['version_platform', '<Your_Version_Platform_Type>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/user/version/{{app_id}}/"

payload = {'user_token': '<Your_User_Token>',
'version_name': '<Your_Version_Name>',
'version_description': '<Your_Version_Description>',
'version_platform': '<Your_Version_Platform_Type>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
],
[
'name' => 'version_name',
'contents' => '<Your_Version_Name>'
],
[
'name' => 'version_description',
'contents' => '<Your_Version_Description>'
],
[
'name' => 'version_platform',
'contents' => '<Your_Version_Platform_Type>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/user/version/{{app_id}}/');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.addFormDataPart("version_name","<Your_Version_Name>")
.addFormDataPart("version_description","<Your_Version_Description>")
.addFormDataPart("version_platform","<Your_Version_Platform_Type>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/user/version/{{app_id}}/")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");
formdata.append("version_name", "<Your_Version_Name>");
formdata.append("version_description", "<Your_Version_Description>");
formdata.append("version_platform", "<Your_Version_Platform_Type>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/user/version/{{app_id}}/", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/user/version/{{app_id}}/"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("version_name", "<Your_Version_Name>")
_ = writer.WriteField("version_description", "<Your_Version_Description>")
_ = writer.WriteField("version_platform", "<Your_Version_Platform_Type>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/user/version/{{app_id}}/");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
content.Add(new StringContent("<Your_Version_Name>"), "version_name");
content.Add(new StringContent("<Your_Version_Description>"), "version_description");
content.Add(new StringContent("<Your_Version_Platform_Type>"), "version_platform");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
    "success": true,
    "message": "Version created.",
    "data": {
        "version_id": 198,
        "version_name": "V1"
    }
}

Get Application Info Copied!

The Get Application Info section allows users to retrieve information about a specific application. By providing the application ID and user token, users can access relevant details and properties associated with the application. This section is essential for retrieving application-specific data without the need for additional requests or manual processes.

Path Parameters

{app_id} string Required

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
POST /api/user/applications/{{app_id}}/
curl --location --globoff 'https://your_domain.testgrid.io/api/user/applications/{{app_id}}/' \
--form 'user_token="<Your_User_Token>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/user/applications/{{app_id}}/")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/user/applications/{{app_id}}/"

payload = {'user_token': '<Your_User_Token>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/user/applications/{{app_id}}/');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/user/applications/{{app_id}}/")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/user/applications/{{app_id}}/", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/user/applications/{{app_id}}/"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/user/applications/{{app_id}}/");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
"success": true,
"message": "Build info",
"data":
{
"app_id": "{Your_app_id}",
"name": "{Your_Application_Name}",
"application_token": "xxxxxxxxxxx",
"cm_version_id": "480,481"
"versions": [
{
"version_id": "481",
"version_name": "API Test1 Version",
"version_description": "",
"platform_type": "android",
"version_token": "xxxxxxxxxxx"
},
{
"version_id": "480",
"version_name": "1",
"version_description": "",
"platform_type": "android",
"version_token": "xxxxxxxxxxx"
}
]
},
}

Get Build Info Copied!

This section allows users to retrieve the build information for a user in the TestGrid API. Users can obtain this information by providing the user token associated with the desired build.

Path Parameters

app_build_id string
The ID of the build for which you need details

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
POST /api/user/buildinfo/{app_build_id}/
curl --location 'https://your_domain.testgrid.io/api/user/buildinfo/<Your_App_Build_ID>/' \
--form 'user_token="<Your_User_Token>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/user/buildinfo/<Your_App_Build_ID>/")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/user/buildinfo/<Your_App_Build_ID>/"

payload = {'user_token': '<Your_User_Token>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/user/buildinfo/<Your_App_Build_ID>/');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/user/buildinfo/<Your_App_Build_ID>/")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/user/buildinfo/<Your_App_Build_ID>/", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/user/buildinfo/<Your_App_Build_ID>/"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/user/buildinfo/<Your_App_Build_ID>/");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
"success": true,
"message": "Build info",
"data":
{
"app_build_id": "272",
"app_id": "223",
"app_build_version": "1",
"build_name": "newAndroidApp",
"file_name": "20251231055110_Z0Yqk.apk",
"user_id": "1",
"version_id": "481",
"platform_type": "android",
"build_server_url": "https://your_domain.testgrid.io/app_build/xxxxxx/223/481/builds/272/xxxxxx.apk",
"bundle_id": "org.asdtm.goodweather"
},
}

Get Build Version Info Copied!

This section allows users to retrieve the build version information for a user in the TestGrid API. Users can obtain this information by providing the user token associated with the desired version.

Path Parameters

{version_id} string Required
The ID of the version for which build information is requested

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
POST /api/user/build/{{version_id}}/
curl --location --globoff 'https://your_domain.testgrid.io/api/user/build/{{version_id}}/' \
--form 'user_token="<Your_User_Token>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/user/build/{{version_id}}/")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/user/build/{{version_id}}/"

payload = {'user_token': '<Your_User_Token>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/user/build/{{version_id}}/');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/user/build/{{version_id}}/")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/user/build/{{version_id}}/", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/user/build/{{version_id}}/"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/user/build/{{version_id}}/");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
"success": true,
"message": "Version info",
"data": {
"user_token": "xxxxxxxxxxx",
"version_token": "xxxxxxxxxxx",
"application_token": "xxxxxxxxxxx",
"application_name": "NewTestAPIApplication",
"version_name": "API Test1 Version",
"version_module_list": "[]",
"app_build_list": "[]"
},
}

App Build Upload Copied!

The App build upload section allows users to upload a new application build to the TG API. By providing the necessary parameters and selecting the IPA or APK file, users can seamlessly add a new version of their mobile application to the system. Optional parameters such as the bundle identifier and build name can also be included to provide additional context for the uploaded build.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
application_token string Required
The token associated with the application. Get Build version api will have application_token.
version_token string Required
The token associated with the version of the app build. Get Build version api will have version_token.
upload_file file Required
The IPA or APK file to be uploaded. Only files with the extension .ipa or .apk are allowed.
bundle_identifier string
The unique identifier for the app bundle. This parameter is optional.
build_name string Required
The name of the app build.
POST /ci/upload_app_build
curl --location 'https://your_domain.testgrid.io/ci/upload_app_build' \
--form 'user_token="<Your_User_Token>"' \
--form 'application_token="<Your_Application_Token>"' \
--form 'version_token="<Your_Version_Token>"' \
--form 'upload_file=@"<Your_Uploaded_File>"' \
--form 'bundle_identifier="<Your_bundle_identifier>"' \
--form 'build_name="<Your_build_name>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/ci/upload_app_build")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>'],['application_token', '<Your_Application_Token>'],['version_token', '<Your_Version_Token>'],['upload_file', File.open('<Your_Uploaded_File>')],['bundle_identifier', '<Your_bundle_identifier>'],['build_name', '<Your_build_name>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/ci/upload_app_build"

payload = {'user_token': '<Your_User_Token>',
'application_token': '<Your_Application_Token>',
'version_token': '<Your_Version_Token>',
'bundle_identifier': '<Your_bundle_identifier>',
'build_name': '<Your_build_name>'}
files=[
('upload_file',('<Your_Uploaded_File>',open('','rb'),'application/octet-stream'))
]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
],
[
'name' => 'application_token',
'contents' => '<Your_Application_Token>'
],
[
'name' => 'version_token',
'contents' => '<Your_Version_Token>'
],
[
'name' => 'upload_file',
'contents' => Utils::tryFopen('<Your_Uploaded_File>', 'r'),
'filename' => '<Your_Uploaded_File>',
'headers' => [
],
[
'name' => 'bundle_identifier',
'contents' => '<Your_bundle_identifier>'
],
[
'name' => 'build_name',
'contents' => '<Your_build_name>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/ci/upload_app_build');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.addFormDataPart("application_token","<Your_Application_Token>")
.addFormDataPart("version_token","<Your_Version_Token>")
.addFormDataPart("upload_file","<Your_Uploaded_File>",
RequestBody.create(MediaType.parse("application/octet-stream"),
new File("<Your_Uploaded_File>")))
.addFormDataPart("bundle_identifier","<Your_bundle_identifier>")
.addFormDataPart("build_name","<Your_build_name>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/ci/upload_app_build")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");
formdata.append("application_token", "<Your_Application_Token>");
formdata.append("version_token", "<Your_Version_Token>");
formdata.append("upload_file", fileInput.files[0], "<Your_Uploaded_File>");
formdata.append("bundle_identifier", "<Your_bundle_identifier>");
formdata.append("build_name", "<Your_build_name>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/ci/upload_app_build", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"os"
"path/filepath"
"io"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/ci/upload_app_build"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("application_token", "<Your_Application_Token>")
_ = writer.WriteField("version_token", "<Your_Version_Token>")
file, errFile4 := os.Open("<Your_Uploaded_File>")
defer file.Close()
part4,
errFile4 := writer.CreateFormFile("upload_file",filepath.Base(""))
_, errFile4 = io.Copy(part4, file)
if errFile4 != nil {
fmt.Println(errFile4)
return
}
_ = writer.WriteField("bundle_identifier", "")
_ = writer.WriteField("build_name", "")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/ci/upload_app_build");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
content.Add(new StringContent("<Your_Application_Token>"), "application_token");
content.Add(new StringContent("<Your_Version_Token>"), "version_token");
content.Add(new StreamContent(File.OpenRead("<Your_Uploaded_File>")), "upload_file", "");
content.Add(new StringContent("<Your_bundle_identifier>"), "bundle_identifier");
content.Add(new StringContent("<Your_build_name>"), "build_name");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
    "status": 1,
    "msg": "Successfully added app build",
    "statuscode": "200",
    "app_build_id": "272",
    "app_build_version": "1",
    "build_name": "newAndroidApp",
    "is_do_not_delete": "0"
}

App Build Install Synchronous Copied!

The synchronous app build install API waits for the application installation to complete and returns a response indicating whether the app was successfully installed or not.

Body Parameters

Body Parameters string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
application_token string Required
The token representing the application.
version_token string Required
The token representing the version of the app.
process_type string Required
The type of the process for app installation. For Example: "oaa" for Android, "oia" for iOS, and "ow" for Web. passed this value accordingly.
s_device string Required
The device on which the app build will be installed.
app_build_id string Required
The ID of the app build.
is_resign string
0 - Do not resign, 1 - Resign IPA file (Optional parameter for installing IPA file with resign option)
disable_secure_flag string
0 - Default, no changes, 1 - To remove the Android secure flag restrictions. (This flag is only for Android)
POST /api/build/app-install
curl --location 'https://your_domain.testgrid.io/api/build/app-install' \
--form 'user_token="<Your_User_Token>"' \
--form 'application_token="<Your_Application_Token>"' \
--form 'version_token="<Your_Version_Token>"' \
--form 'process_type="<Your_Process_Type>"' \
--form 's_device="<Your_s_device>"' \
--form 'app_build_id="<Your_App_Build_id>"' \
--form 'is_resign="<0 or 1>"' \
--form 'disable_secure_flag="<0 or 1>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/build/app-install")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>'],['application_token', '<Your_Application_Token>'],['version_token', '<Your_Version_Token>'],['process_type', '<Your_Process_Type>'],['s_device', '<Your_s_device>'],['app_build_id', '<Your_App_Build_id>'],['is_resign', '<0 or 1>'],['disable_secure_flag', '<0 or 1>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/build/app-install"

payload = {'user_token': '<Your_User_Token>',
'application_token': '<Your_Application_Token>',
'version_token': '<Your_Version_Token>',
'process_type': '<Your_Process_Type>',
's_device': '<Your_s_device>',
'app_build_id': '<Your_App_Build_id>',
'is_resign': '<0 or 1>',
'disable_secure_flag': '<0 or 1>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
],
[
'name' => 'application_token',
'contents' => '<Your_Application_Token>'
],
[
'name' => 'version_token',
'contents' => '<Your_Version_Token>'
],
[
'name' => 'process_type',
'contents' => '<Your_Process_Type>'
],
[
'name' => 's_device',
'contents' => '<Your_s_device>'
],
[
'name' => 'app_build_id',
'contents' => '<Your_App_Build_id>'
],
[
'name' => 'is_resign',
'contents' => '<0 or 1>'
],
[
'name' => 'disable_secure_flag',
'contents' => '<0 or 1>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/build/app-install');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.addFormDataPart("application_token","<Your_Application_Token>")
.addFormDataPart("version_token","<Your_Version_Token>")
.addFormDataPart("process_type","<Your_Process_Type>")
.addFormDataPart("s_device","<Your_s_device>")
.addFormDataPart("app_build_id","<Your_App_Build_id>")
.addFormDataPart("is_resign","<0 or 1>")
.addFormDataPart("disable_secure_flag","<0 or 1>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/build/app-install")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");
formdata.append("application_token", "<Your_Application_Token>");
formdata.append("version_token", "<Your_Version_Token>");
formdata.append("process_type", "<Your_Process_Type>");
formdata.append("s_device", "<Your_s_device>");
formdata.append("app_build_id", "<Your_App_Build_id>");
formdata.append("is_resign", "<0 or 1>");
formdata.append("disable_secure_flag", "<0 or 1>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/build/app-install", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/build/app-install"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("application_token", "<Your_Application_Token>")
_ = writer.WriteField("version_token", "<Your_Version_Token>")
_ = writer.WriteField("process_type", "<Your_Process_Type>")
_ = writer.WriteField("s_device", "<Your_s_device>")
_ = writer.WriteField("app_build_id", "<Your_App_Build_id>")
_ = writer.WriteField("is_resign", "<0 or 1>")
_ = writer.WriteField("disable_secure_flag", "<0 or 1>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/build/app-install");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
content.Add(new StringContent("<Your_Application_Token>"), "application_token");
content.Add(new StringContent("<Your_Version_Token>"), "version_token");
content.Add(new StringContent("<Your_Process_Type>"), "process_type");
content.Add(new StringContent("<Your_s_device>"), "s_device");
content.Add(new StringContent("<Your_App_Build_id>"), "app_build_id");
content.Add(new StringContent("<0 or 1>"), "is_resign");
content.Add(new StringContent("<0 or 1>"), "disable_secure_flag");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
    "success": true,
    "message": "Application installed Successfully"
}

App Build Install Copied!

The App Build Install section allows users to integrate and install app builds seamlessly. By providing the necessary parameters, users can easily deploy app builds to their desired devices or processes. This API triggers the installation but does not wait for the app to be fully installed before responding.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
application_token string Required
The token representing the application.
version_token string Required
The token representing the version of the app.
process_type string Required
The type of the process for app installation. For Example: "oaa" for Android, "oia" for iOS, and "ow" for Web. passed this value accordingly.
s_device string Required
The device on which the app build will be installed.
app_build_id string Required
The ID of the app build.
is_resign string
0 - Do not resign, 1 - Resign IPA file (Optional parameter for installing IPA file with resign option)
POST /ci/app_build_install
curl --location 'https://your_domain.testgrid.io/ci/app_build_install' \
--form 'user_token="<Your_User_Token>"' \
--form 'application_token="<Your_Application_Token>"' \
--form 'version_token="<Your_Version_Token>"' \
--form 'process_type="<Your_Process_Type>"' \
--form 's_device="<Your_s_device>"' \
--form 'app_build_id="<Your_App_Build_id>"' \
--form 'is_resign="<0 or 1>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/ci/app_build_install")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>'],['application_token', '<Your_Application_Token>'],['version_token', '<Your_Version_Token>'],['process_type', '<Your_Process_Type>'],['s_device', '<Your_s_device>'],['app_build_id', '<Your_App_Build_id>'],['is_resign', '<0 or 1>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/ci/app_build_install"

payload = {'user_token': '<Your_User_Token>',
'application_token': '<Your_Application_Token>',
'version_token': '<Your_Version_Token>',
'process_type': '<Your_Process_Type>',
's_device': '<Your_s_device>',
'app_build_id': '<Your_App_Build_id>',
'is_resign': '<0 or 1>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
],
[
'name' => 'application_token',
'contents' => '<Your_Application_Token>'
],
[
'name' => 'version_token',
'contents' => '<Your_Version_Token>'
],
[
'name' => 'process_type',
'contents' => '<Your_Process_Type>'
],
[
'name' => 's_device',
'contents' => '<Your_s_device>'
],
[
'name' => 'app_build_id',
'contents' => '<Your_App_Build_id>'
],
[
'name' => 'is_resign',
'contents' => '<0 or 1>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/ci/app_build_install');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.addFormDataPart("application_token","<Your_Application_Token>")
.addFormDataPart("version_token","<Your_Version_Token>")
.addFormDataPart("process_type","<Your_Process_Type>")
.addFormDataPart("s_device","<Your_s_device>")
.addFormDataPart("app_build_id","<Your_App_Build_id>")
.addFormDataPart("is_resign","<0 or 1>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/ci/app_build_install")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");
formdata.append("application_token", "<Your_Application_Token>");
formdata.append("version_token", "<Your_Version_Token>");
formdata.append("process_type", "<Your_Process_Type>");
formdata.append("s_device", "<Your_s_device>");
formdata.append("app_build_id", "<Your_App_Build_id>");
formdata.append("is_resign", "<0 or 1>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/ci/app_build_install", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/ci/app_build_install"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("application_token", "<Your_Application_Token>")
_ = writer.WriteField("version_token", "<Your_Version_Token>")
_ = writer.WriteField("process_type", "<Your_Process_Type>")
_ = writer.WriteField("s_device", "<Your_s_device>")
_ = writer.WriteField("app_build_id", "<Your_App_Build_id>")
_ = writer.WriteField("is_resign", "<0 or 1>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/ci/app_build_install");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
content.Add(new StringContent("<Your_Application_Token>"), "application_token");
content.Add(new StringContent("<Your_Version_Token>"), "version_token");
content.Add(new StringContent("<Your_Process_Type>"), "process_type");
content.Add(new StringContent("<Your_s_device>"), "s_device");
content.Add(new StringContent("<Your_App_Build_id>"), "app_build_id");
content.Add(new StringContent("<0 or 1>"), "is_resign");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
"status": 1,
"msg": "Successfully started the installation process on device."
"response_url": "https://your_domain.testgrid.io/device-cloud/apps/uploadlogs/xxxxxx.txt"
}

Delete Uploaded Builds Copied!

The Delete uploaded builds section allows users to remove previously uploaded builds associated with their account. By using this functionality, users can easily manage their uploaded builds and ensure that only the relevant ones are retained.

Path Parameters

{app_build_id} string Required
The ID of the app build to be removed.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
POST /api/user/removebuilds/{{app_build_id}}/
curl --location --globoff 'https://your_domain.testgrid.io/api/user/removebuilds/{{app_build_id}}/' \
--form 'user_token="<Your_User_Token>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/user/removebuilds/{{app_build_id}}/")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/user/removebuilds/{{app_build_id}}/"

payload = {'user_token': '<Your_User_Token>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/user/removebuilds/{{app_build_id}}/');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/user/removebuilds/{{app_build_id}}/")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/user/removebuilds/{{app_build_id}}/", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/user/removebuilds/{{app_build_id}}/"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/user/removebuilds/{{app_build_id}}/");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
    "success": true,
    "message": "Build removed successfully."
}

Run Native Test iOS Copied!

It refers to initiating automated tests specifically designed for iOS applications using native development frameworks and tools

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
build_name string Required
The name of the app build.
app_id string Required
The unique identifier for the specific build or version of the application being referenced.
device_id string Required
The unique identifier for the device on which the application is installed.
file file Required
The XCTestRun Zip file to be uploaded. Only files with the extension .zip are allowed.
version_id string Required
The version id of your application
POST /api/run-native-test-ios
curl --location 'https://your_domain.testgrid.io/api/run-native-test-ios' \
--form 'user_token="<your_user_token>"' \
--form 'build_name="<Your_build_name>"' \
--form 'app_id="<Your_app_id>"' \
--form 'device_id="<Your_device_id>"' \
--form 'file=@"<Your_Uploaded_File>"' \
--form 'version_id="<Your_version_Id>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/run-native-test-ios")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_user_token>'],['build_name', '<Your_build_name>'],['app_id', '<Your_app_id>'],['device_id', '<Your_device_id>'],['file', File.open('<Your_Uploaded_File>
')],['version_id', '<Your_version_Id>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/run-native-test-ios"

payload = {'user_token': '<Your_user_token>',
'build_name': '<Your_build_name>',
'app_id': '<Your_app_id>',
'device_id': '<Your_device_id>',
'version_id': '<Your_version_Id>'}
files=[
('file',('<Your_Uploaded_File>
',open('<Your_Uploaded_File>','rb'),'application/octet-stream'))
]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_user_token>'
],
[
'name' => 'build_name',
'contents' => '<Your_build_name>'
],
[
'name' => 'app_id',
'contents' => '<Your_app_id>'
],
[
'name' => 'device_id',
'contents' => '<Your_device_id>'
],
[
'name' => 'file',
'contents' => Utils::tryFopen('<Your_Uploaded_File>
', 'r'),
'filename' => '<Your_Uploaded_File>',
'headers' => [
'Content-Type' => '<Content-type header>'
]
],
[
'name' => 'version_id',
'contents' => '<Your_version_Id>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/run-native-test-ios');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_user_token>")
.addFormDataPart("build_name","<Your_build_name>")
.addFormDataPart("app_id","<Your_app_id>")
.addFormDataPart("device_id","<Your_device_id>")
.addFormDataPart("file","<Your_Uploaded_File>",
RequestBody.create(MediaType.parse("application/octet-stream"),
new File("<Your_Uploaded_File>
")))
.addFormDataPart("version_id","<Your_version_Id>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/run-native-test-ios")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_user_token>\r");
formdata.append("build_name", "<Your_build_name>\r");
formdata.append("app_id", "<Your_app_id>\r");
formdata.append("device_id", "<Your_device_id>\r");
formdata.append("file", fileInput.files[0], "<Your_Uploaded_File>
");
formdata.append("version_id", "<Your_version_Id>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/run-native-test-ios", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"os"
"path/filepath"
"io"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/run-native-test-ios"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_user_token>\r")
_ = writer.WriteField("build_name", "<Your_build_name>\r")
_ = writer.WriteField("app_id", "<Your_app_id>\r")
_ = writer.WriteField("device_id", "<Your_device_id>\r")
file, errFile5 := os.Open("<Your_Uploaded_File>
")
defer file.Close()
part5,
errFile5 := writer.CreateFormFile("file",filepath.Base("<Your_Uploaded_File>
"))
_, errFile5 = io.Copy(part5, file)
if errFile5 != nil {
fmt.Println(errFile5)
return
}
_ = writer.WriteField("version_id", "<Your_version_Id>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/run-native-test-ios");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_user_token>
"), "user_token");
content.Add(new StringContent("<Your_build_name>
"), "build_name");
content.Add(new StringContent("<Your_app_id>
"), "app_id");
content.Add(new StringContent("<Your_device_id>
"), "device_id");
content.Add(new StreamContent(File.OpenRead("<Your_Uploaded_File>
")), "file", "<Your_Uploaded_File>
");
content.Add(new StringContent("<Your_version_Id>"), "version_id");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
"success": true,
"message": "Successfully started native test execution on server"
"url": "https://your_domain.testgrid.io/apps/native-test/73"
}

Run Native Test Android Copied!

It refers to initiating automated tests specifically designed for Android applications using native development frameworks and tools

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
build_name string Required
The name of the app build.
app_build_id string Required
The unique identifier for the specific build or version of the application being referenced.
device_id string Required
The unique identifier for the device on which the application is installed.
file file Required
The APK file to be uploaded. Only files with the extension .apk are allowed.
POST /api/run-native-test
curl --location 'https://your_domain.testgrid.io/api/run-native-test' \
--form 'user_token="<your_user_token>"' \
--form 'build_name="<Your_build_name>"' \
--form 'app_build_id="<Your_app_build_id>"' \
--form 'device_id="<Your_device_id>"' \
--form 'file=@"<Your_Uploaded_File>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/run-native-test")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<your_user_token>'],['build_name', '<Your_build_name>'],['app_build_id', '<Your_app_build_id>'],['device_id', '<Your_device_id>'],['file', File.open('<Your_Uploaded_File>')]]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/run-native-test"

payload = {'user_token': '<your_user_token>',
'build_name': '<Your_build_name>',
'app_build_id': '<Your_app_build_id>',
'device_id': '<Your_device_id>'}
files=[
('file',('<Your_Uploaded_File>',open('','rb'),'application/octet-stream'))
]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<your_user_token>'
],
[
'name' => 'build_name',
'contents' => '<Your_build_name>'
],
[
'name' => 'app_build_id',
'contents' => '<Your_app_build_id>'
],
[
'name' => 'device_id',
'contents' => '<Your_device_id>'
],
[
'name' => 'file',
'contents' => Utils::tryFopen('', 'r'),
'filename' => '<Your_Uploaded_File>',
'headers' => [
]
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/run-native-test');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<your_user_token>")
.addFormDataPart("build_name","<Your_build_name>")
.addFormDataPart("app_build_id","<Your_app_build_id>")
.addFormDataPart("device_id","<Your_device_id>")
.addFormDataPart("file","<Your_Uploaded_File>",
RequestBody.create(MediaType.parse("application/octet-stream"),
new File("<Your_Uploaded_File>")))
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/run-native-test")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<your_user_token>\r");
formdata.append("build_name", "<Your_build_name>\r");
formdata.append("app_build_id", "<Your_app_build_id>\r");
formdata.append("device_id", "<Your_device_id>\r");
formdata.append("file", fileInput.files[0], "<Your_Uploaded_File>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/run-native-test", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"os"
"path/filepath"
"io"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/run-native-test"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<your user token>\r")
_ = writer.WriteField("build_name", "<Your_build_name>\r")
_ = writer.WriteField("app_build_id", "<Your_app_build_id>\r")
_ = writer.WriteField("device_id", "<Your_device_id>\r")
file, errFile5 := os.Open("<Your_Uploaded_File>")
defer file.Close()
part5,
errFile5 := writer.CreateFormFile("file",filepath.Base("<Your_Uploaded_File>"))
_, errFile5 = io.Copy(part5, file)
if errFile5 != nil {
fmt.Println(errFile5)
return
}
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}

res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/run-native-test");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<your_user_token>"), "user_token");
content.Add(new StringContent("<Your_build_name>"), "build_name");
content.Add(new StringContent("<Your_app_build_id>"), "app_build_id");
content.Add(new StringContent("<Your_device_id>"), "device_id");
content.Add(new StreamContent(File.OpenRead("<Your_Uploaded_File>")), "file", "<Your_Uploaded_File>");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
    "success": true,
    "message": "Successfully started native test execution on server",
    "native_test_build_id": "71",
    "url": "https://your_domain.testgrid.io/apps/native-test/71"
}

Get Native Test Results Copied!

Fetches the test result details for a specific native test build ID. The response contains device-specific test execution metadata, logs, recordings, and pass/fail statistics.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
native_test_build_id string Required
Build ID for which results are requested.
POST /api/get-native-test-result
curl --location 'https://your_domain.testgrid.io/api/get-native-test-result' \
--form 'user_token="<Your_User_Token>"'
--form 'native_test_build_id="<Your_Native_Test_build_id>"'
require "uri"
require "json"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/get-native-test-result")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
request.body = JSON.dump({
"user_token": "<Your_User_Token>",
"native_test_build_id": "<Your_Native_Test_build_id>"
})

response = https.request(request)
puts response.read_body
import requests
import json

url = "https://your_domain.testgrid.io/api/get-native-test-result"

payload = json.dumps({
"user_token": "<Your_User_Token>",
"native_test_build_id": "<Your_Native_Test_build_id>"
})
headers = {
}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
<?php
$client = new Client();
$headers = [
];
$body = '{
"user_token": "<Your_User_Token>",
"native_test_build_id": "<Your_Native_Test_build_id>"
}';
$request = new Request('POST', 'https://your_domain.testgrid.io/api/get-native-test-result', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{
\"user_token\": \"<Your_User_Token>\",
\"native_test_build_id\": \"<Your_Native_Test_build_id>\"
}");
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/get-native-test-result")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var myHeaders = new Headers();

var raw = JSON.stringify({
"user_token": "<Your_User_Token>",
"native_test_build_id": "<Your_Native_Test_build_id>"
});

var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/get-native-test-result", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/get-native-test-result"
method := "POST"

payload := strings.NewReader(`{
"user_token": "<Your_User_Token>",
"native_test_build_id": "<Your_Native_Test_build_id>"
}`)

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}

res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/get-native-test-result");
var content = new StringContent("{
\"user_token\": \"<Your_User_Token>\",
\"native_test_build_id\": \"<Your_Native_Test_build_id>\"
}");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
"success": true,
"message": "Native Test Result Fetched Successfully.",
"data":[
{
"device_id": "3",
"device_name": "Galaxy S21 FE 5G",
"UDID": "xxxxxxxxxxx",
"platform_version": "14",
"created": "2025-12-31 06:39:01",
"device_plateform": "Android",
"log_path": "https://your_domain.testgrid.io/process/test_result/native_test/xxxxxxxxxxx/71/xxxxxxxxxxx/log.txt",
"device_recording_path": "",
"status": "3",
"status_text": "Failed",
"all_testcase": "0",
"passed_testcase": "0",
"failed_testcase": "0"
},
]
}

App Upload Direct Copied!

The App build upload section allows users to upload a new application build to the TG API. By providing the necessary parameters and selecting the IPA or APK file, users can seamlessly add a new version of their mobile application to the system.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
platform string Required
1: iOS, 2: Android
upload_file file Required
The IPA or APK file to be uploaded. Only files with the extension .ipa or .apk are allowed.
POST /api/app-upload
curl --location 'https://your_domain.testgrid.io/api/app-upload' \
--form 'user_token="<Your_User_token>"' \
--form 'platform="\"iOS or Android"' \
--form 'upload_file=@"<Your_Uploaded_File>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/app-upload")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_token>'],['platform', '"iOS or Android'],['upload_file', File.open('<Your_Uploaded_File>')]]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/app-upload"

payload = {'user_token': '<Your_User_token>',
'platform': '"iOS or Android'}
files=[
('upload_file',('<Your_Uploaded_File>',open('','rb'),'application/octet-stream'))
]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_token>'
],
[
'name' => 'platform',
'contents' => '"iOS or Android'
],
[
'name' => 'upload_file',
'contents' => Utils::tryFopen('', 'r'),
'filename' => '<Your_Uploaded_File>',
'headers' => [
'Content-Type' => '<Your_Uploaded_File>'
]
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/app-upload');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_token>")
.addFormDataPart("platform","\"iOS or Android")
.addFormDataPart("upload_file","<Your_Uploaded_File>",
RequestBody.create(MediaType.parse("application/octet-stream"),
new File("<Your_Uploaded_File>")))
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/app-upload")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_token>");
formdata.append("platform", "\"iOS or Android");
formdata.append("upload_file", fileInput.files[0], ""<Your_Uploaded_File>);

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/app-upload", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"os"
"path/filepath"
"io"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/app-upload"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_token>")
_ = writer.WriteField("platform", "\"iOS or Android")
file, errFile3 := os.Open("<Your_Uploaded_File>")
defer file.Close()
part3,
errFile3 := writer.CreateFormFile("upload_file",filepath.Base(""))
_, errFile3 = io.Copy(part3, file)
if errFile3 != nil {
fmt.Println(errFile3)
return
}
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/app-upload");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_token>"), "user_token");
content.Add(new StringContent("\"iOS or Android"), "platform");
content.Add(new StreamContent(File.OpenRead("<Your_Uploaded_File>")), "upload_file", "");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
"status": true,
"message": "Successfully added app build",
"app_build_id": "273",
}

App Install Direct Copied!

The App Install Direct API allows users to install a previously uploaded APK or IPA (using App Upload Direct API) build onto a specific Android or iOS device connected to the server. By passing parameters such as the Device ID, users can seamlessly deploy the desired application build onto the target device for testing.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
app_build_id string Required
The ID of the build for which you need details
device_id string Required
The unique identifier for the device on which the application is installed.
is_resign string
0 - Do not resign, 1 - Resign IPA file (Optional parameter for installing IPA file with resign option)
POST /api/app-install
curl --location 'https://your_domain.testgrid.io/api/app-install' \
--form 'user_token="<Your_user_token>"' \
--form 'app_build_id="<Your_App_Build_id>"' \
--form 'device_id="<Your_Device_Id>"' \
--form 'is_resign="<0 or 1>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/app-install")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_user_token>'],['app_build_id', '<Your_App_Build_id>'],['device_id', '<Your_Device_Id>'],['is_resign', '<0 or 1>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/app-install"

payload = {'user_token': '<Your_user_token>',
'app_build_id': '<Your_App_Build_id>',
'device_id': '<Your_Device_Id>',
'is_resign': '<0 or 1>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_user_token>'
],
[
'name' => 'app_build_id',
'contents' => '<Your_App_Build_id>'
],
[
'name' => 'device_id',
'contents' => '<Your_Device_Id>'
],
[
'name' => 'is_resign',
'contents' => '<0 or 1>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/app-install');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_user_token>")
.addFormDataPart("app_build_id","<Your_App_Build_id>")
.addFormDataPart("device_id","<Your_Device_Id>")
.addFormDataPart("is_resign","<0 or 1>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/app-install")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_user_token>\r");
formdata.append("app_build_id", "<Your_App_Build_id>\r");
formdata.append("device_id", "<Your_Device_Id>");
formdata.append("is_resign", "<0 or 1>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/app-install", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/app-install"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_user_token>\r")
_ = writer.WriteField("app_build_id", "<Your_App_Build_id>\r")
_ = writer.WriteField("device_id", "<Your_Device_Id>")
_ = writer.WriteField("is_resign", "<0 or 1>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/app-install");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_user_token>"), "user_token");
content.Add(new StringContent("<Your_App_Build_id>"), "app_build_id");
content.Add(new StringContent("<Your_Device_Id>"), "device_id");
content.Add(new StringContent("<0 or 1>"), "is_resign");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
"status": true,
"message": "Successfully started the installation process on device.",
"response_url": "https://your_domain.testgrid.io/device-cloud/apps/uploadlogs/xxxxxxxxxx.txt",
}

Device Cloud Copied!

Device Cloud is a section of the TG_API_Documents project that allows users to access and manage devices in the cloud. Users can perform various actions related to device management, such as retrieving device information, updating device settings, and monitoring device status.

App Auto Launch Copied!

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
device_id string Required
bundle_id string Required
POST /api/device/app-auto-launch
curl --location 'https://your_domain.testgrid.io/api/device/app-auto-launch' \
--header 'Cookie: _testgrid=f0e358109b1818071f8157995e8f9b16' \
--form 'user_token="<Your_User_Token>"' \
--form 'device_id="<Your_Device_id>"' \
--form 'bundle_id="<Your_bundle_id>"'
require 'net/http'
require 'uri'

uri = URI.parse("https://your_domain.testgrid.io/api/device/app-auto-launch")

request = Net::HTTP::Post.new(uri)
request["Cookie"] = "_testgrid=f0e358109b1818071f8157995e8f9b16"

form_data = [
['user_token', '<Your_User_Token>'],
['device_id', '<Your_Device_id>'],
['bundle_id', '<Your_bundle_id>']
]

request.set_form form_data, 'multipart/form-data'

response = Net::HTTP.start(uri.hostname, uri.port,
use_ssl: uri.scheme == "https") do |http|
http.request(request)
end

puts response.body
import requests

url = "https://your_domain.testgrid.io/api/device/app-auto-launch"

headers = {
"Cookie": "_testgrid=f0e358109b1818071f8157995e8f9b16"
}

data = {
"user_token": "<Your_User_Token>",
"device_id": "<Your_Device_id>",
"bundle_id": "<Your_bundle_id>"
}

response = requests.post(url, headers=headers, data=data)

print("Status Code:", response.status_code)
print("Response:", response.text)
<?php

$url = "https://your_domain.testgrid.io/api/device/app-auto-launch";

$ch = curl_init();

curl_setopt_array($ch, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"Cookie: _testgrid=f0e358109b1818071f8157995e8f9b16"
],
CURLOPT_POSTFIELDS => [
"user_token" => "<Your_User_Token>",
"device_id" => "<Your_Device_id>",
"bundle_id" => "<Your_bundle_id>"
],
]);

$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);

curl_close($ch);

echo "Status Code: " . $httpCode . "\n";
echo "Response: " . $response;
import okhttp3.*;

import java.io.IOException;

public class AppAutoLaunch {
public static void main(String[] args) throws IOException {

OkHttpClient client = new OkHttpClient();

RequestBody body = new MultipartBody.Builder()
.setType(MultipartBody.FORM)
.addFormDataPart("user_token", "<Your_User_Token>")
.addFormDataPart("device_id", "<Your_Device_id>")
.addFormDataPart("bundle_id", "<Your_bundle_id>")
.build();

Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/device/app-auto-launch")
.addHeader("Cookie", "_testgrid=f0e358109b1818071f8157995e8f9b16")
.post(body)
.build();

Response response = client.newCall(request).execute();

System.out.println("Status Code: " + response.code());
System.out.println("Response: " + response.body().string());
}
}
const axios = require('axios');
const FormData = require('form-data');

const form = new FormData();
form.append('user_token', '<Your_User_Token>');
form.append('device_id', '<Your_Device_id>');
form.append('bundle_id', '<Your_bundle_id>');

axios.post(
'https://your_domain.testgrid.io/api/device/app-auto-launch',
form,
{
headers: {
...form.getHeaders(),
'Cookie': '_testgrid=f0e358109b1818071f8157995e8f9b16'
}
}
)
.then(response => {
console.log('Status Code:', response.status);
console.log('Response:', response.data);
})
.catch(error => {
console.error('Error:', error.response?.data || error.message);
});
package main

import (
"bytes"
"fmt"
"io"
"mime/multipart"
"net/http"
)

func main() {
url := "https://your_domain.testgrid.io/api/device/app-auto-launch"

var requestBody bytes.Buffer
writer := multipart.NewWriter(&requestBody)

// Add form fields
writer.WriteField("user_token", "<Your_User_Token>")
writer.WriteField("device_id", "<Your_Device_id>")
writer.WriteField("bundle_id", "<Your_bundle_id>")

writer.Close()

req, err := http.NewRequest("POST", url, &requestBody)
if err != nil {
panic(err)
}

req.Header.Set("Content-Type", writer.FormDataContentType())
req.Header.Set("Cookie", "_testgrid=f0e358109b1818071f8157995e8f9b16")

client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()

body, _ := io.ReadAll(resp.Body)

fmt.Println("Status Code:", resp.StatusCode)
fmt.Println("Response:", string(body))
}
using System;
using System.Net.Http;
using System.Threading.Tasks;

class Program
{
static async Task Main()
{
var url = "https://your_domain.testgrid.io/api/device/app-auto-launch";

using var client = new HttpClient();

client.DefaultRequestHeaders.Add("Cookie", "_testgrid=f0e358109b1818071f8157995e8f9b16");

using var form = new MultipartFormDataContent
{
{ new StringContent("<Your_User_Token>"), "user_token" },
{ new StringContent("<Your_Device_id>"), "device_id" },
{ new StringContent("<Your_bundle_id>"), "bundle_id" }
};

var response = await client.PostAsync(url, form);
var responseBody = await response.Content.ReadAsStringAsync();

Console.WriteLine($"Status Code: {response.StatusCode}");
Console.WriteLine($"Response: {responseBody}");
}
}

Biometric Bypass Copied!

Biometric authentication is a method of verifying the identity of a user based on their biological characteristics, such as fingerprints. This approach is employed to enhance the security and convenience of software applications.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
device_id string Required
Unique identifier of the target device. Specifies the device where biometric bypass will be applied.
apk_ipa_file string Required
Mobile application file (APK for Android / IPA for iOS). The app is uploaded and injected with biometric bypass logic.
biometric_status string Required
Defines the biometric authentication result.
  • pass → Biometric authentication succeeds
  • fail → Biometric authentication fails
resign string
Indicates whether the application should be resigned.
  • true → App will be resigned
  • false → Original app signature is preserved
POST /api/device/install/biometric-bypass
curl --location 'https://your_domain.testgrid.io/api/device/install/biometric-bypass' \
--header 'Cookie: _testgrid=f0e358109b1818071f8157995e8f9b16' \
--form 'user_token="<Your_User_Token>"' \
--form 'device_id="<Your_Device_id>"' \
--form 'apk_ipa_file=@"File.open('<Your_Uploaded_File>')"' \
--form 'biometric_status="pass"' \
--form 'resign="false"'
require 'net/http'
require 'uri'
require 'json'
require 'net/http/post/multipart'

uri = URI.parse("https://your_domain.testgrid.io/api/device/install/biometric-bypass")

# Build the request
request = Net::HTTP::Post::Multipart.new(
uri.path,
"user_token" => "<Your_User_Token>",
"device_id" => "<Your_Device_id>",
"apk_ipa_file" => UploadIO.new(
File.open("<Your_Uploaded_File>"),
"application/octet-stream",
File.basename("<Your_Uploaded_File>")
),
"biometric_status" => "pass",
"resign" => "false"
)

# Headers
request["Cookie"] = "_testgrid=f0e358109b1818071f8157995e8f9b16"

# Send request
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

response = http.request(request)

puts response.code
puts response.body
import requests

url = "https://your_domain.testgrid.io/api/device/install/biometric-bypass"

headers = {
"Cookie": "_testgrid=f0e358109b1818071f8157995e8f9b16"
}

data = {
"user_token": "<Your_User_Token>",
"device_id": "<Your_Device_id>",
"biometric_status": "pass",
"resign": "false"
}

files = {
"apk_ipa_file": open("<Your_Uploaded_File>", "rb")
}

response = requests.post(
url,
headers=headers,
data=data,
files=files
)

print("Status Code:", response.status_code)
print("Response:", response.text)
<?php

$url = "https://your_domain.testgrid.io/api/device/install/biometric-bypass";

$headers = [
"Cookie: _testgrid=f0e358109b1818071f8157995e8f9b16"
];

$postFields = [
"user_token" => "<Your_User_Token>",
"device_id" => "<Your_Device_id>",
"biometric_status" => "pass",
"resign" => "false",
"apk_ipa_file" => new CURLFile(
"<Your_Uploaded_File>",
"application/octet-stream",
basename("<Your_Uploaded_File>")
)
];

$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => $headers,
CURLOPT_POSTFIELDS => $postFields,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_SSL_VERIFYPEER => true,
]);

$response = curl_exec($ch);

if ($response === false) {
echo "cURL Error: " . curl_error($ch);
} else {
echo "Response: " . $response;
}

curl_close($ch);
import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

public class BiometricBypassUpload {

public static void main(String[] args) throws Exception {

String boundary = "----WebKitFormBoundary" + UUID.randomUUID();
String url = "https://your_domain.testgrid.io/api/device/install/biometric-bypass";

HttpRequest.BodyPublisher body = ofMimeMultipartData(
boundary,
"<Your_User_Token>",
"<Your_Device_id>",
"pass",
"false",
new File("<Your_Uploaded_File>")
);

HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Content-Type", "multipart/form-data; boundary=" + boundary)
.header("Cookie", "_testgrid=f0e358109b1818071f8157995e8f9b16")
.POST(body)
.build();

HttpClient client = HttpClient.newHttpClient();
HttpResponse<String> response =
client.send(request, HttpResponse.BodyHandlers.ofString());

System.out.println("Status Code: " + response.statusCode());
System.out.println("Response: " + response.body());
}

private static HttpRequest.BodyPublisher ofMimeMultipartData(
String boundary,
String userToken,
String deviceId,
String biometricStatus,
String resign,
File file
) throws IOException {

List<byte[]> byteArrays = new ArrayList<>();
String separator = "--" + boundary + "\r\n";
String ending = "--" + boundary + "--";

// user_token
byteArrays.add((separator +
"Content-Disposition: form-data; name=\"user_token\"\r\n\r\n" +
userToken + "\r\n").getBytes(StandardCharsets.UTF_8));

// device_id
byteArrays.add((separator +
"Content-Disposition: form-data; name=\"device_id\"\r\n\r\n" +
deviceId + "\r\n").getBytes(StandardCharsets.UTF_8));

// biometric_status
byteArrays.add((separator +
"Content-Disposition: form-data; name=\"biometric_status\"\r\n\r\n" +
biometricStatus + "\r\n").getBytes(StandardCharsets.UTF_8));

// resign
byteArrays.add((separator +
"Content-Disposition: form-data; name=\"resign\"\r\n\r\n" +
resign + "\r\n").getBytes(StandardCharsets.UTF_8));

// file
byteArrays.add((separator +
"Content-Disposition: form-data; name=\"apk_ipa_file\"; filename=\"" + file.getName() + "\"\r\n" +
"Content-Type: application/octet-stream\r\n\r\n")
.getBytes(StandardCharsets.UTF_8));

byteArrays.add(Files.readAllBytes(file.toPath()));
byteArrays.add("\r\n".getBytes(StandardCharsets.UTF_8));

// end boundary
byteArrays.add(ending.getBytes(StandardCharsets.UTF_8));

return HttpRequest.BodyPublishers.ofByteArrays(byteArrays);
}
}
const axios = require("axios");
const FormData = require("form-data");
const fs = require("fs");

const url = "https://your_domain.testgrid.io/api/device/install/biometric-bypass";

const form = new FormData();
form.append("user_token", "<Your_User_Token>");
form.append("device_id", "<Your_Device_id>");
form.append("biometric_status", "pass");
form.append("resign", "false");
form.append("apk_ipa_file", fs.createReadStream("<Your_Uploaded_File>"));

axios.post(url, form, {
headers: {
...form.getHeaders(),
Cookie: "_testgrid=f0e358109b1818071f8157995e8f9b16"
},
maxBodyLength: Infinity,
maxContentLength: Infinity
})
.then(response => {
console.log("Status:", response.status);
console.log("Response:", response.data);
})
.catch(error => {
if (error.response) {
console.error("Error:", error.response.status, error.response.data);
} else {
console.error("Error:", error.message);
}
});
package main
import (
"bytes"
"fmt"
"io"
"mime/multipart"
"net/http"
"os"
)
func main() {
url := "https://your_domain.testgrid.io/api/device/install/biometric-bypass"
file, err := os.Open("<Your_Uploaded_File>")
if err != nil {
panic(err)
}
defer file.Close()
body := &bytes.Buffer{}
writer := multipart.NewWriter(body)
// Normal fields
writer.WriteField("user_token", "<Your_User_Token>")
writer.WriteField("device_id", "<Your_Device_id>")
writer.WriteField("biometric_status", "pass")
writer.WriteField("resign", "false")
// File field
part, err := writer.CreateFormFile("apk_ipa_file", file.Name())
if err != nil {
panic(err)
}
io.Copy(part, file)
writer.Close()
req, err := http.NewRequest("POST", url, body)
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", writer.FormDataContentType())
req.Header.Set("Cookie", "_testgrid=f0e358109b1818071f8157995e8f9b16")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
respBody, _ := io.ReadAll(resp.Body)
fmt.Println("Status Code:", resp.StatusCode)
fmt.Println("Response:", string(respBody))
}
using System;
using System.IO;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;

class Program
{
static async Task Main()
{
var url = "https://your_domain.testgrid.io/api/device/install/biometric-bypass";

using var client = new HttpClient();

// Cookie header
client.DefaultRequestHeaders.Add(
"Cookie",
"_testgrid=f0e358109b1818071f8157995e8f9b16"
);

using var form = new MultipartFormDataContent();

// Form fields
form.Add(new StringContent("<Your_User_Token>"), "user_token");
form.Add(new StringContent("<Your_Device_id>"), "device_id");
form.Add(new StringContent("pass"), "biometric_status");
form.Add(new StringContent("false"), "resign");

// File upload
var fileStream = File.OpenRead("<Your_Uploaded_File>");
var fileContent = new StreamContent(fileStream);
fileContent.Headers.ContentType =
new MediaTypeHeaderValue("application/octet-stream");

form.Add(fileContent, "apk_ipa_file", Path.GetFileName("<Your_Uploaded_File>"));

var response = await client.PostAsync(url, form);
var responseBody = await response.Content.ReadAsStringAsync();

Console.WriteLine("Status Code: " + response.StatusCode);
Console.WriteLine("Response: " + responseBody);
}
}

Image Injection Copied!

Image injection is a technique that allows you to test applications that use the device camera by providing them with an image that simulates the camera input. It is used to verify the app’s functionality and behavior based on the injected image. Image injection can help you test your app’s camera features faster, easier, and more reliably.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
device_id string Required
The unique identifier of the device on which the application will be installed and the image will be injected.
apk_ipa_file string Required
The application file to be installed on the device.
  • Use .apk for Android applications
  • Use .ipa for iOS applications
image string Required
The image file to be injected as the device camera input. Supported file formats include JPEG, PNG, and GIF.
resign string
Specifies whether the application should be resigned before installation. This parameter is primarily applicable for iOS (IPA) files and is optional.
POST /api/device/install/image-injection
curl --location 'https://your_domain.testgrid.io/api/device/install/image-injection' \
--header 'Cookie: _testgrid=f0e358109b1818071f8157995e8f9b16' \
--form 'user_token="<Your_User_Token>"' \
--form 'device_id="<Your_device_id>"' \
--form 'apk_ipa_file=@"File.open('<Your_Uploaded_File>')"' \
--form 'image=@"<Your_Image>"' \
--form 'resign=""'
require 'net/http'
require 'uri'

uri = URI.parse("https://your_domain.testgrid.io/api/device/install/image-injection")

request = Net::HTTP::Post.new(uri)
request["Cookie"] = "_testgrid=f0e358109b1818071f8157995e8f9b16"

form_data = [
['user_token', '<Your_User_Token>'],
['device_id', '<Your_device_id>'],
['apk_ipa_file', File.open('<Your_Uploaded_File>')],
['image', '<Your_Image>'],
['resign', '']
]

request.set_form(form_data, 'multipart/form-data')

http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true

response = http.request(request)

puts response.code
puts response.body
import requests

url = "https://your_domain.testgrid.io/api/device/install/image-injection"

data = {
"user_token": "<Your_User_Token>",
"device_id": "<Your_device_id>",
"resign": ""
}

files = {
"apk_ipa_file": open("<Your_Uploaded_File>", "rb"),
"image": open("<Your_Image>", "rb")
}

response = requests.post(url, data=data, files=files)

print(response.status_code)
print(response.text)
<?php

$url = "https://your_domain.testgrid.io/api/device/install/image-injection";

$postFields = [
'user_token' => '<Your_User_Token>',
'device_id' => '<Your_device_id>',
'resign' => '',
'apk_ipa_file' => new CURLFile(
'<Your_Uploaded_File>',
'application/octet-stream',
basename('<Your_Uploaded_File>')
),
'image' => new CURLFile(
'<Your_Image>',
'image/png',
basename('<Your_Image>')
),
];

$ch = curl_init($url);

curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $postFields,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Cookie: _testgrid=f0e358109b1818071f8157995e8f9b16'
],
]);

$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);

if ($response === false) {
echo 'cURL Error: ' . curl_error($ch);
}

curl_close($ch);

echo "HTTP Code: " . $httpCode . PHP_EOL;
echo $response;
import org.apache.http.HttpEntity;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.mime.MultipartEntityBuilder;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

import java.io.File;

public class ImageInjectionUpload {

public static void main(String[] args) throws Exception {

String url = "https://your_domain.testgrid.io/api/device/install/image-injection";

HttpPost post = new HttpPost(url);

// Cookie header
post.setHeader("Cookie", "_testgrid=f0e358109b1818071f8157995e8f9b16");

MultipartEntityBuilder builder = MultipartEntityBuilder.create();

// Text fields
builder.addTextBody("user_token", "<Your_User_Token>");
builder.addTextBody("device_id", "<Your_device_id>");
builder.addTextBody("resign", "");

// File fields
builder.addBinaryBody(
"apk_ipa_file",
new File("<Your_Uploaded_File>"),
ContentType.APPLICATION_OCTET_STREAM,
new File("<Your_Uploaded_File>").getName()
);

builder.addBinaryBody(
"image",
new File("<Your_Image>"),
ContentType.IMAGE_PNG,
new File("<Your_Image>").getName()
);

HttpEntity multipart = builder.build();
post.setEntity(multipart);

try (CloseableHttpClient client = HttpClients.createDefault();
CloseableHttpResponse response = client.execute(post)) {

System.out.println("HTTP Status: " + response.getStatusLine().getStatusCode());
System.out.println(EntityUtils.toString(response.getEntity()));
}
}
}
const axios = require("axios");
const FormData = require("form-data");
const fs = require("fs");

const url = "https://your_domain.testgrid.io/api/device/install/image-injection";

const form = new FormData();

// Text fields
form.append("user_token", "<Your_User_Token>");
form.append("device_id", "<Your_device_id>");
form.append("resign", "");

// File fields
form.append(
"apk_ipa_file",
fs.createReadStream("<Your_Uploaded_File>")
);

form.append(
"image",
fs.createReadStream("<Your_Image>")
);

axios.post(url, form, {
headers: {
...form.getHeaders(),
"Cookie": "_testgrid=f0e358109b1818071f8157995e8f9b16"
},
maxBodyLength: Infinity, // important for large APKs
maxContentLength: Infinity
})
.then(response => {
console.log("Status:", response.status);
console.log(response.data);
})
.catch(error => {
if (error.response) {
console.error("Error:", error.response.status, error.response.data);
} else {
console.error("Error:", error.message);
}
});
package main

import (
"bytes"
"fmt"
"io"
"mime/multipart"
"net/http"
"os"
)

func main() {
url := "https://your_domain.testgrid.io/api/device/install/image-injection"

body := &bytes.Buffer{}
writer := multipart.NewWriter(body)

// Text fields
_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("device_id", "<Your_device_id>")
_ = writer.WriteField("resign", "")

// APK / IPA file
apkFile, err := os.Open("<Your_Uploaded_File>")
if err != nil {
panic(err)
}
defer apkFile.Close()

apkPart, err := writer.CreateFormFile("apk_ipa_file", "app.apk")
if err != nil {
panic(err)
}
_, _ = io.Copy(apkPart, apkFile)

// Image file
imageFile, err := os.Open("<Your_Image>")
if err != nil {
panic(err)
}
defer imageFile.Close()

imagePart, err := writer.CreateFormFile("image", "screenshot.png")
if err != nil {
panic(err)
}
_, _ = io.Copy(imagePart, imageFile)

// Close writer (important!)
writer.Close()

req, err := http.NewRequest("POST", url, body)
if err != nil {
panic(err)
}

// Headers
req.Header.Set("Content-Type", writer.FormDataContentType())
req.Header.Set("Cookie", "_testgrid=f0e358109b1818071f8157995e8f9b16")

client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()

respBody, _ := io.ReadAll(resp.Body)

fmt.Println("HTTP Status:", resp.StatusCode)
fmt.Println(string(respBody))
}
using System;
using System.IO;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;

class Program
{
static async Task Main()
{
var url = "https://your_domain.testgrid.io/api/device/install/image-injection";

using var client = new HttpClient();

// Cookie header
client.DefaultRequestHeaders.Add(
"Cookie",
"_testgrid=f0e358109b1818071f8157995e8f9b16"
);

using var form = new MultipartFormDataContent();

// Text fields
form.Add(new StringContent("<Your_User_Token>"), "user_token");
form.Add(new StringContent("<Your_device_id>"), "device_id");
form.Add(new StringContent(""), "resign");

// APK / IPA file
var apkStream = File.OpenRead("<Your_Uploaded_File>");
var apkContent = new StreamContent(apkStream);
apkContent.Headers.ContentType =
new MediaTypeHeaderValue("application/octet-stream");

form.Add(apkContent, "apk_ipa_file", Path.GetFileName("<Your_Uploaded_File>"));

// Image file
var imageStream = File.OpenRead("<Your_Image>");
var imageContent = new StreamContent(imageStream);
imageContent.Headers.ContentType =
new MediaTypeHeaderValue("image/png");

form.Add(imageContent, "image", Path.GetFileName("<Your_Image>"));

// Send request
var response = await client.PostAsync(url, form);
var responseBody = await response.Content.ReadAsStringAsync();

Console.WriteLine("HTTP Status: " + response.StatusCode);
Console.WriteLine(responseBody);
}
}

Get Device List Copied!

This section allows users to retrieve all devices associated with a specific user using their user token. By making use of this API, users can easily access and manage the devices linked to a particular user within the TestGrid Project.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
POST /api/get-user-devices
curl --location 'https://your_domain.testgrid.io/api/get-user-devices' \
--form 'user_token="<Your_User_Token>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/get-user-devices")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/get-user-devices"

payload = {'user_token': '<Your_User_Token>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/get-user-devices');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/get-user-devices")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/get-user-devices", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/get-user-devices"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/get-user-devices");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
"success": true,
"message": "Device Fetch Successfully.",
"data": [
{
"device_id": "31",
"UDID": "xxxxxxxxxxx",
"tags": "iOSRegression",
"device_type": "1",
"platform_version": "18.3.1",
"device_name": "iPhone 12 Pro Max",
"manufactured_by": "Apple",
"chamber_number": "",
"s_device": "903JFV",
"web_socket_audio_port": "43006",
"web_socket_video_port": "44006",
"wda_local_port": "3006",
"system_port": "",
"is_run_generator": "0",
"is_run_build": "0",
"is_run_local_execution": "0",
"is_run_virtual_usb": "0",
"is_run_device_cloud": "1",
"is_offline": "0",
"is_connected": "1",
"is_device_offline": "0",
"is_unauthorised": "0",
"is_rebooting": "0",
"is_reserved": "0",
"is_preparing": "0",
"is_cleaning": "0",
"reserved_device_user_id": "0",
"device_simulation_type": "Real",
"imei": "["Your_imei_1","Your_imei_2"]",
"server_type": "1",
"reserved_device_user_email": "",
"mobile_number": "",
"device_processor_name": "A11 Bionic",
"device_location": "null",
"device_data_room": "null",
"device_data_center": "null",
"appium_url": "https://your_domain.testgrid.io/appium_36006/wd/hub",
"remotelite_url": "",
"mobile_number": "iOS",
"automation_name": "XCUITest"
},
]
}

Get All Devices with Filter Copied!

This section allows users to retrieve information about all devices based on specified filters. By providing parameters such as user token, platform version, and device type, users can obtain a list of devices that meet their criteria.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
platform_version string
The version of the platform (e.g., Android, iOS, web) on which the device is running.
device_type string
The type of device (e.g., Android, iOS, web) to filter the devices by. This parameter is optional.
device_id string
The Unique integer number assigned to Device. Device Id
POST /api/get-devices-info
curl --location 'https://your_domain.testgrid.io/api/get-devices-info' \
--form 'user_token="<Your_User_Token>"' \
--form 'platform_version="<Your_Platform_Version>"' \
--form 'device_type="<Your_Device_Type>"' \
--form 'device_id="<Your_Device_Id>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/get-devices-info")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>'],['platform_version', '<Your_Platform_Version>'],['device_type', '<Your_Device_Type>'],['device_id', '<Your_Device_Id>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/get-devices-info"

payload = {'user_token': '<Your_User_Token>',
'platform_version': '<Your_Platform_Version>',
'device_type': '<Your_Device_Type>',
'device_id': '<Your_Device_Id>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
],
[
'name' => 'platform_version',
'contents' => '<Your_Platform_Version>'
],
[
'name' => 'device_type',
'contents' => '<Your_Device_Type>'
],
[
'name' => 'device_id',
'contents' => '<Your_Device_Id>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/get-devices-info');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.addFormDataPart("platform_version","<Your_Platform_Version>")
.addFormDataPart("device_type","<Your_Device_Type>")
.addFormDataPart("device_id","<Your_Device_Id>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/get-devices-info")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");
formdata.append("platform_version", "<Your_Platform_Version>");
formdata.append("device_type", "<Your_Device_Type>");
formdata.append("device_id", "<Your_Device_Id>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/get-devices-info", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/get-devices-info"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("platform_version", "<Your_Platform_Version>")
_ = writer.WriteField("device_type", "<Your_Device_Type>")
_ = writer.WriteField("device_id", "<Your_Device_Id>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/get-devices-info");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
content.Add(new StringContent("<Your_Platform_Version>"), "platform_version");
content.Add(new StringContent("<Your_Device_Type>"), "device_type");
content.Add(new StringContent("<Your_Device_Id>"), "device_id");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
    "success": true,
    "message": "Device Fetch Successfully.",
    "devices": {
        "device_id": 27,
        "UDID": "",
        "device_name": "Galaxy S23",
        "model_name": "",
        "serial_number": "",
        "device_type": "android/ios",
        "platform_version": "15",
        "system_port": "4007",
        "browser_free_url": "",
        "mobile_number": "",
        "device_processor_name": "Snapdragon 888",
        "device_location": "null",
        "device_data_room": "null",
        "device_data_center": "null",
        "tags": "",
        "appium_url": "",
        "remotelite_url": "",
        "device_status": "Available"
    }
}

Device Logs Copied!

The Device Logs section allows users to retrieve device logs for the device cloud session.

Path Parameters

device_id string
The device_id is a path parameter that specifies the ID of the device for which the device logs needed.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
POST /api/user/device-logs/{device_id}/
curl --location --globoff 'https://your_domain.testgrid.io/api/user/device-logs/{device_id}/' \
--form 'user_token="<Your_User_Token>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/user/device-logs/{device_id}/")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/user/device-logs/{device_id}/"

payload = {'user_token': '<Your_User_Token>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/user/device-logs/{device_id}/');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/user/device-logs/{device_id}/")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/user/device-logs/{device_id}/", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/user/device-logs/{device_id}/"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/user/device-logs/{device_id}/");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
    "success": true,
    "message": "Device logs",
    "log_file_url": "https://your_domain.testgrid.io/device-cloud/DeviceLogs/RFCR101K8JE/DeviceLog.txt"
}

All Automation Build Results Copied!

The All Automation Build Results API endpoint retrieves information on automation execution results. Utilizing a POST request, it requires a user token and supports parameters like project name, device ID, build number, last minutes, and session name. The server responds with a JSON array containing details of automation builds, including build ID, project name, device ID, build number, last execution duration in minutes, and session(Test case) name. This API proves essential for obtaining a comprehensive overview of automated test executions, aiding in monitoring, analysis, and reporting within a testing environment.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
project_name string
Provide a project name for which you want to get automation test results
device_id string Required
Provide a device_id of a device for which you want to get automation test results
build_number string
Provide build_number to get result of all builds executed before that build number.
last_minutes string
You can pass the pass time duration for which you want the execution results.
session_name string
Test case name for which you want to get execution results.
Languages Box
cURL cURL
Ruby Ruby
Python Python
PHP PHP
Java Java
Node.js Node.js
Go Go
.NET .NET
POST /api/user/builds
curl --location 'https://your_domain.testgrid.io/api/user/builds' \
--form 'user_token="<Your_User_Token>"' \
--form 'project_name="<Your_Project_Name>"' \
--form 'device_id="<Your_Device_ID>"' \
--form 'build_number="<Your_Build_Number>"' \
--form 'last_minutes="<Your_Last_Minutes>"' \
--form 'session_name="<Your_Session_Name>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/user/builds")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>'],['project_name', '<Your_Project_Name>'],['device_id', '<Your_Device_ID>'],['build_number', '<Your_Build_Number>'],['last_minutes', '<Your_Last_Minutes>'],['session_name', '<Your_Session_Name>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/user/builds"

payload = {'user_token': '<Your_User_Token>',
'project_name': '<Your_Project_Name>',
'device_id': '<Your_Device_ID>',
'build_number': '<Your_Build_Number>',
'last_minutes': '<Your_Last_Minutes>',
'session_name': '<Your_Session_Name>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
],
[
'name' => 'project_name',
'contents' => '<Your_Project_Name>'
],
[
'name' => 'device_id',
'contents' => '<Your_Device_ID>'
],
[
'name' => 'build_number',
'contents' => '<Your_Build_Number>'
],
[
'name' => 'last_minutes',
'contents' => '<Your_Last_Minutes>'
],
[
'name' => 'session_name',
'contents' => '<Your_Session_Name>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/user/builds');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.addFormDataPart("project_name","<Your_Project_Name>")
.addFormDataPart("device_id","<Your_Device_ID>")
.addFormDataPart("build_number","<Your_Build_Number>")
.addFormDataPart("last_minutes","<Your_Last_Minutes>")
.addFormDataPart("session_name","<Your_Session_Name>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/user/builds")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");
formdata.append("project_name", "<Your_Project_Name>");
formdata.append("device_id", "<Your_Device_ID>");
formdata.append("build_number", "<Your_Build_Number>");
formdata.append("last_minutes", "<Your_Last_Minutes>");
formdata.append("session_name", "<Your_Session_Name>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/user/builds", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/user/builds"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("project_name", "<Your_Project_Name>")
_ = writer.WriteField("device_id", "<Your_Device_ID>")
_ = writer.WriteField("build_number", "<Your_Build_Number>")
_ = writer.WriteField("last_minutes", "<Your_Last_Minutes>")
_ = writer.WriteField("session_name", "<Your_Session_Name>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/user/builds");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
content.Add(new StringContent("<Your_Project_Name>"), "project_name");
content.Add(new StringContent("<Your_Device_ID>"), "device_id");
content.Add(new StringContent("<Your_Build_Number>"), "build_number");
content.Add(new StringContent("<Your_Last_Minutes>"), "last_minutes");
content.Add(new StringContent("<Your_Session_Name>"), "session_name");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
"status": true,
"data":[
{
"build_number": "3031",
"session_name": "12Dec_P1",
"project_name": "undefined",
"testcase_name": "12Dec_P1",
"created": "2025-12-19 15:20:49",
},
{
"build_number": "3031",
"session_name": "12Dec_P1",
"project_name": "project1",
"testcase_name": "12Dec_P1",
"created": "2025-12-19 15:20:49",
},
]
}

Automation Build Results and Logs Copied!

The Automation Build Results and Logs API allows users to get automation session logs of specific test execution. It will return the results of test execution like logs, video url and test case execution time, tester name.

Path Parameters

{build_number} string Required
Provide build_number of the automation execution results that you can get from All Automation Build Results API

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
POST /api/user/logs/{{build_number}}/
curl --location --globoff 'https://your_domain.testgrid.io/api/user/logs/{{build_number}}/' \
--form 'user_token="<Your_User_Token>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/user/logs/{{build_number}}/")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/user/logs/{{build_number}}/"

payload = {'user_token': '<Your_User_Token>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/user/logs/{{build_number}}/');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/user/logs/{{build_number}}/")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/user/logs/{{build_number}}/", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/user/logs/{{build_number}}/"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/user/logs/{{build_number}}/");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
    "status": true,
    "message": "Log info",
    "data": [
        {
            "logs": "All build logs",
            "device_type": "1",
            "username": "310bb27eae55c0da80d5a3730abbd8485881454116d4ccdc5552b4f1ea56f79b",
            "name": "iPhone 12 Pro Max",
            "version": "18.3.1",
            "image": "iPhone 12 Pro Max",
            "src": "https://your_domain.testgrid.io/device-cloud/Logs/appium/xxxxxxxxxxxx/xxxxx/Recording.mp4",
            "duration": "61",
            "start_date": "2026-01-08 14:17:30.424",
            "end_date": "2026-01-08 14:18:32.384",
            "status": "1"
        }
    ]
}

Get First Available Device Capabilities Builder Copied!

This section of the TestGrid API allows users to retrieve the first available device capabilities builder. With this functionality, users can easily access and utilize the necessary tools and resources for device capability building without needing to manually search for them.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
device_type string Required
The type of the device. Accepted values are 'ios', 'android', or 'web'.
device_name string
The name of the device to be used.
os_version string
The version of the operating system installed on the device.
device_tag string
The name of the Device Tag for the device you want to get details
manufactured_by string
The name of the manufacturer of the device. You can get it from Get All Devices API.
project_name string
The name of the Project that you want to assign to your test case
Order_By string
Pass 'rand' to retrieve a random device that is available for testing.
POST /api/cap-builder
curl --location 'https://your_domain.testgrid.io/api/cap-builder' \
--form 'user_token="<Your_User_Token>"' \
--form 'device_type="<Your_Device_Type>"' \
--form 'device_name="<Your_Device_Name>"' \
--form 'os_version="<Your_os_version>"' \
--form 'device_tag="<Tag_Name>"' \
--form 'manufactured_by="<Manufacturer_Name>"' \
--form 'project_name="<Project_Name>"'\
--form 'order_by="rand"'\
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/cap-builder")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>'],['device_type', '<Your_Device_Type>'],['device_name', '<Your_Device_Name>'],['os_version', '<Your_os_version>'],['device_tag', '<Tag_Name>'],['manufactured_by', '<Manufacturer_Name>'],['project_name','<Project_Name>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/cap-builder"

payload = {'user_token': '<Your_User_Token>',
'device_type': '<Your_Device_Type>',
'device_name': '<Your_Device_Name>',
'os_version': '<Your_os_version>',
'device_tag': '<Tag_Name>',
'manufactured_by': '<Manufacturer_Name>',
'project_name': '<Project_Name>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
],
[
'name' => 'device_type',
'contents' => '<Your_Device_Type>'
],
[
'name' => 'device_name',
'contents' => '<Your_Device_Name>'
],
[
'name' => 'os_version',
'contents' => '<Your_os_version>'
],
[
'name' => 'device_tag',
'contents' => '<Tag_Name>'
],
[
'name' => 'manufactured_by',
'contents' => '<Manufacturer_Name>'
],
[
'name' => 'project_name',
'contents' => '<Project_Name>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/cap-builder');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.addFormDataPart("device_type","<Your_Device_Type>")
.addFormDataPart("device_name","<Your_Device_Name>")
.addFormDataPart("os_version","<Your_os_version>")
.addFormDataPart("device_tag","<Tag_Name>")
.addFormDataPart("manufactured_by","<Manufacturer_Name>")
.addFormDataPart("project_name","<Project_Name>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/cap-builder")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");
formdata.append("device_type", "<Your_Device_Type>");
formdata.append("device_name", "<Your_Device_Name>");
formdata.append("os_version", "<Your_os_version>");
formdata.append("device_tag", "<Tag_Name>");
formdata.append("manufactured_by", "<Manufacturer_Name>");
formdata.append("project_name", "<Project_Name>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/cap-builder", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/cap-builder"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("device_type", "<Your_Device_Type>")
_ = writer.WriteField("device_name", "<Your_Device_Name>")
_ = writer.WriteField("os_version", "<Your_os_version>")
_ = writer.WriteField("device_tag", "<Tag_Name>")
_ = writer.WriteField("manufactured_by", "<Manufacturer_Name>")
_ = writer.WriteField("project_name", "<Project_Name>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/cap-builder");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
content.Add(new StringContent("<Your_Device_Type>"), "device_type");
content.Add(new StringContent("<Your_Device_Name>"), "device_name");
content.Add(new StringContent("<Your_os_version>"), "os_version");
content.Add(new StringContent("<Tag_Name>"), "device_tag");
content.Add(new StringContent("<Manufacturer_Name>"), "manufactured_by");
content.Add(new StringContent("<Project_Name>"), "project_name");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
"status": true,
"data":{
"device_id": "3",
"appium_url": "https://your_domain.testgrid.io/appium_xxxxx/wd/hub",
"s_device": "xxxxxxx",
"platform_name": "android",
"device_name": "Galaxy S21 FE 5G",
"platform_version": "14",
"automation_name": "UiAutomator2",
"udid": "xxxxxxx",
"imei": ""Unknown"",
"user_token": "xxxxxxxxxxx",
"system_port": "xxxx",
"remote_host": "your_domain.testgrid.io",
"remote_path": "/wd/hub",
"remote_port": "xxxx",
"project_name": "",
},
}

Release Device Copied!

Users can use the Release Device section to release a device associated with a specific user token. This feature allows users to release the device from their account.

Path Parameters

{device_id} string Required
The ID of the device that need to be released.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
POST /api/user/releasedevice/{{device_id}}/
curl --location --globoff 'https://your_domain.testgrid.io/api/user/releasedevice/{{device_id}}/' \
--form 'user_token="<Your_User_Token>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/user/releasedevice/{{device_id}}/")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/user/releasedevice/{{device_id}}/"

payload = {'user_token': '<Your_User_Token>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/user/releasedevice/{{device_id}}/');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/user/releasedevice/{{device_id}}/")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/user/releasedevice/{{device_id}}/", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/user/releasedevice/{{device_id}}/"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/user/releasedevice/{{device_id}}/");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
    "success": true,
    "message": "Device released successfully."
}

Reserve device Copied!

The Reserve Device section enables users to reserve a device by specifying the user token, device ID (in the URL), start and end date/time, timezone, and optional comments, allowing effective management of device reservations within the TestGrid API Project.

Path Parameters

{user_id} string Required
The ID of the user reserving the device.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
device_id string Required
The ID of the device being reserved. Get all devices api will give you the device_id
start_date_time string Required
The date and time when the reservation starts. Format: yyyy-MM-dd HH:mm:ss
end_date_time string Required
The date and time when the reservation ends. Format: yyyy-MM-dd HH:mm:ss
timezone string Required
The timezone name in which the reservation is being made. Format: Time Zone name. example: Asia/Kolkata, America/New_York
comments string Required
Additional comments or notes for the reservation.
POST /api/user/reservedevice/{{user_id}}/
curl --location --globoff 'https://your_domain.testgrid.io/api/user/reservedevice/{{user_id}}/' \
--form 'user_token="<Your_User_Token>"' \
--form 'device_id="<Your_Device_id>"' \
--form 'start_date_time="<Your_start_date_time>"' \
--form 'end_date_time="<Your_end_date_time>"' \
--form 'timezone="<Your_Time_Zone>"' \
--form 'comments="<Your_Comments>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/user/reservedevice/{{user_id}}/")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>'],['device_id', '<Your_Device_id>'],['start_date_time', '<Your_start_date_time>'],['end_date_time', '<Your_end_date_time>'],['timezone', '<Your_Time_Zone>'],['comments', '<Your_Comments>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/user/reservedevice/{{user_id}}/"

payload = {'user_token': '<Your_User_Token>',
'device_id': '<Your_Device_id>',
'start_date_time': '<Your_start_date_time>',
'end_date_time': '<Your_end_date_time>',
'timezone': '<Your_Time_Zone>',
'comments': '<Your_Comments>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
],
[
'name' => 'device_id',
'contents' => '<Your_Device_id>'
],
[
'name' => 'start_date_time',
'contents' => '<Your_start_date_time>'
],
[
'name' => 'end_date_time',
'contents' => '<Your_end_date_time>'
],
[
'name' => 'timezone',
'contents' => '<Your_Time_Zone>'
],
[
'name' => 'comments',
'contents' => '<Your_Comments>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/user/reservedevice/{{user_id}}/');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.addFormDataPart("device_id","<Your_Device_id>")
.addFormDataPart("start_date_time","<Your_start_date_time>")
.addFormDataPart("end_date_time","<Your_end_date_time>")
.addFormDataPart("timezone","<Your_Time_Zone>")
.addFormDataPart("comments","<Your_Comments>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/user/reservedevice/{{user_id}}/")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");
formdata.append("device_id", "<Your_Device_id>");
formdata.append("start_date_time", "<Your_start_date_time>");
formdata.append("end_date_time", "<Your_end_date_time>");
formdata.append("timezone", "<Your_Time_Zone>");
formdata.append("comments", "<Your_Comments>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/user/reservedevice/{{user_id}}/", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/user/reservedevice/{{user_id}}/"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("device_id", "<Your_Device_id>")
_ = writer.WriteField("start_date_time", "<Your_start_date_time>")
_ = writer.WriteField("end_date_time", "<Your_end_date_time>")
_ = writer.WriteField("timezone", "<Your_Time_Zone>")
_ = writer.WriteField("comments", "<Your_Comments>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/user/reservedevice/{{user_id}}/");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
content.Add(new StringContent("<Your_Device_id>"), "device_id");
content.Add(new StringContent("<Your_start_date_time>"), "start_date_time");
content.Add(new StringContent("<Your_end_date_time>"), "end_date_time");
content.Add(new StringContent("<Your_Time_Zone>"), "timezone");
content.Add(new StringContent("<Your_Comments>"), "comments");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
    "success": true,
    "message": "Device reservation request added.",
    "device_reservation_id": "2696",
    "ReservationStatus": "Accepted"
}

Reserve Device List Copied!

The Reserve Device List API retrieves a list of devices currently reserved by a specific user. This API is useful for tracking which devices are allocated to a user at any given time, along with the reservation details.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
timezone string Required
The timezone name in which the reservation is being made. Format: Time Zone name. example: Asia/Kolkata, America/New_York
POST /api/user/reservedevicelist
curl --location 'https://your_domain.testgrid.io/api/user/reservedevicelist' \
--form 'user_token="<Your_User_Token>"' \
--form 'timezone="<Your_Time_Zone>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/user/reservedevicelist")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>'],['timezone', '<Your_Time_Zone>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/user/reservedevicelist"

payload = {'user_token': '<Your_User_Token>',
'timezone': '<Your_Time_Zone>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
],
[
'name' => 'timezone',
'contents' => '<Your_Time_Zone>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/user/reservedevicelist');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.addFormDataPart("timezone","")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/user/reservedevicelist")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");
formdata.append("timezone", "<Your_Time_Zone>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/user/reservedevicelist", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/user/reservedevicelist"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("timezone", "<Your_Time_Zone>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/user/reservedevicelist");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
content.Add(new StringContent("<Your_Time_Zone>"), "timezone");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
"success": true,
"message": "Successfully getting device reservation list",
"data":[
{
"device_reservation_id": "xxxx",
"device_id": "18",
"device_name": "Simulator iPhone 16",
"start_date_time": "2026-01-28 12:35:00",
"end_date_time": "2026-01-29 12:35:00",
"comments": "all rules apply"
},
{
"device_reservation_id": "xxxx",
"device_id": "29",
"device_name": "iPhone 15",
"start_date_time": "2026-01-31 10:32:00",
"end_date_time": "2026-02-01 10:32:00",
"comments": "the device needs to be reboot"
},
]
}

Release-Reserve Device Copied!

The Release Device section allows users to release a device associated with a specific user token. By utilizing this feature, users can remove the device from the user’s account, granting them the ability to use the device with a different user token.

Release Reservation: This option is used when the slot is currently in use. It indicates that the reservation is active and the user is utilizing the device. So once we call this API, we release the device and make it free for other users.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
device_reservation_id string Required
This ID you can get from Reserve Devices List API
POST /api/user/releasereservedevice
curl --location 'https://your_domain.testgrid.io/api/user/releasereservedevice' \
--form 'user_token="<Your_User_Token>"' \
--form 'device_reservation_id="<Device_Reservation_ID>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/user/releasereservedevice")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>'],['device_reservation_id', '<Device_Reservation_ID>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/user/releasereservedevice"

payload = {'user_token': '<Your_User_Token>',
'device_reservation_id': '<Device_Reservation_ID>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
],
[
'name' => 'device_reservation_id',
'contents' => '<Device_Reservation_ID>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/user/releasereservedevice');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.addFormDataPart("device_reservation_id","<Device_Reservation_ID>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/user/releasereservedevice")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");
formdata.append("device_reservation_id", "<Device_Reservation_ID>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/user/releasereservedevice", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/user/releasereservedevice"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("device_reservation_id", "<Device_Reservation_ID>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/user/releasereservedevice");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
content.Add(new StringContent("<Device_Reservation_ID>"), "device_reservation_id");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
"success": true,
"message": "Device reservation request released.",
}

Cancel-Reserve Device Copied!

The Cancel-Reserve Device API allows users to cancel a previously approved device reservation slot before the reserved time slot begins. This ensures that devices are freed up for others when the reservation is no longer needed. The API can only be used if the reservation request was approved and the reserved time has not yet started.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
device_reservation_id string Required
The device ID is generated during the device reservation process.
POST /api/user/cancelreservedevice
curl --location 'https://your_domain.testgrid.io/api/user/cancelreservedevice' \
--form 'user_token="<Your_User_Token>"' \
--form 'device_reservation_id="<Your_device_reservation_id>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/user/cancelreservedevice")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>'],['device_reservation_id', '<Your_device_reservation_id>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/user/cancelreservedevice"

payload = {'user_token': '<Your_User_Token>',
'device_reservation_id': '<Your_device_reservation_id>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
],
[
'name' => 'device_reservation_id',
'contents' => '<Your_device_reservation_id>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/user/cancelreservedevice');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.addFormDataPart("device_reservation_id","<Your_device_reservation_id>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/user/cancelreservedevice")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");
formdata.append("device_reservation_id", "<Your_device_reservation_id>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/user/cancelreservedevice", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/user/cancelreservedevice"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("device_reservation_id", "<Your_device_reservation_id>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/user/cancelreservedevice");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
content.Add(new StringContent("<Your_device_reservation_id>"), "device_reservation_id");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
"success": true,
"message": "Device reservation request cancelled.",
}

ADB File Upload Copied!

Uploads an APK or IPA file using the ADB file upload API endpoint. Ensure proper authentication and authorization before using this API.Verify file size limits and supported file types for upload. Handle and validate responses from the server appropriately.

Executes a shell command (pm list users | grep "New user") on a remote server specified by the API endpoint.

Uploads an APK or IPA file using the ADB file upload API endpoint.

Path Parameters

device_id string Required

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
file file Required
The IPA or APK file to be uploaded. Only files with the extension .ipa or .apk are allowed.
POST /api/user/adb-file-upload/{device_id}
curl --location --globoff 'https://your_domain.testgrid.io/api/user/adb-file-upload/{device_id}' \
--form 'user_token="<Your_User_Token>"' \
--form 'file=@"<Your_Uploaded_File>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/user/adb-file-upload/{device_id}")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>'],['file', File.open('<Your_Uploaded_File>')]]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/user/adb-file-upload/{device_id}"

payload = {'user_token': '<Your_User_Token>'}
files=[
('file',('<Your_Uploaded_File>',open('','rb'),'application/octet-stream'))
]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
],
[
'name' => 'file',
'contents' => Utils::tryFopen('', 'r'),
'filename' => '<Your_Uploaded_File>',
'headers' => [
'Content-Type' => ''
]
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/user/adb-file-upload/{device_id}');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.addFormDataPart("file","<Your_Uploaded_File>",
RequestBody.create(MediaType.parse("application/octet-stream"),
new File("<Your_Uploaded_File>")))
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/user/adb-file-upload/{device_id}")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");
formdata.append("file", fileInput.files[0], "<Your_Uploaded_File>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/user/adb-file-upload/{device_id}", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"os"
"path/filepath"
"io"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/user/adb-file-upload/{device_id}"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
file, errFile2 := os.Open("<Your_Uploaded_File>")
defer file.Close()
part2,
errFile2 := writer.CreateFormFile("file",filepath.Base(""))
_, errFile2 = io.Copy(part2, file)
if errFile2 != nil {
fmt.Println(errFile2)
return
}
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/execute-shell-adb-native/1");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
content.Add(new StringContent("<Your_Uploaded_File>"), "command");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
"status": true,
"message": "File uploaded successfully.",
"data": {
"device_id": "26",
"file_id": "94",
"path": "/xxx/xxxx/xxx/uploads/demo.png",
}
}

ADB Pull and Push Copied!

This endpoint allows you to execute an ADB (Android Debug Bridge) pull command to transfer a file from an Android device to the server.Ensure that the session IDs (ci_session) in the Cookie header are valid and have the necessary permissions to execute ADB commands. Verify the paths and filenames according to your specific use case.

This API allows users to execute ADB shell commands on a connected Android device using TestGrid. It enables operations such as file transfers, application installations, and other device-level commands. Request Parameters

This API requires sending a multipart form request with the following parameters:

Parameter

Type

Description

user_token

String

Authentication token for API access

command

String

The ADB shell command to execute on the device

Example Use Case: Pushing a File to Device

The following command transfers a file from the server to the device’s storage:

Command Syntax: command=”push <Your_source_file_path> <your device destination path where you push>”

Example: command=”push /path/to/source/file.png /storage/emulated/0/Download/destination.png”

Example Use Case: Pulling a File from Device

The following command retrieves a file from the device’s storage to the server:

Command Syntax: command=”pull <your device destination path where you push> TGFileName=<your_file & Which format you want to pull>” // you can use any extensions like .jpeg, .png, jpg .xml etc…

Example: command=”pull /storage/emulated/0/Download/api-test.png TGFileName=api-test.png”

POST /api/execute-shell-adb-native/1
curl --location 'https://your_domain.testgrid.io/api/execute-shell-adb-native/1' \
--form 'user_token="<Your_User_Token>"' \
--form 'command="<pull /storage/emulated/0/Download/ABCD.jpg TGFileName=tgnewpull.png>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/execute-shell-adb-native/1")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>'],['command', '<pull /storage/emulated/0/Download/ABCD.jpg TGFileName=tgnewpull.png>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/execute-shell-adb-native/1"

payload = {'user_token': '<Your_User_Token>',
'command': '<pull /storage/emulated/0/Download/ABCD.jpg TGFileName=tgnewpull.png>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
],
[
'name' => 'command',
'contents' => '<pull /storage/emulated/0/Download/ABCD.jpg TGFileName=tgnewpull.png>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/execute-shell-adb-native/1');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.addFormDataPart("command","<pull /storage/emulated/0/Download/ABCD.jpg TGFileName=tgnewpull.png>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/execute-shell-adb-native/1")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");
formdata.append("command", "<pull /storage/emulated/0/Download/ABCD.jpg TGFileName=tgnewpull.png>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/execute-shell-adb-native/1", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/execute-shell-adb-native/1"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("command", "<pull /storage/emulated/0/Download/ABCD.jpg TGFileName=tgnewpull.png>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/execute-shell-adb-native/1");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
content.Add(new StringContent("<pull /storage/emulated/0/Download/ABCD.jpg TGFileName=tgnewpull.png>"), "command");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
"success": true,
"message": "Command executed successfully.",
"output": "Users:ntUserInfo{0:Owner:4c13} running",
"file_url": "",
}

Android Execute Shell Adb Native Copied!

This endpoint allows you to use the API to directly execute an ADB shell command on specific Android devices.

Path Parameters

device_id string Required

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
command string Required
Ex: adb shell pm clear
POST /api/execute-shell-adb-native/{device_id}
curl --location --globoff 'https://your_domain.testgrid.io/api/execute-shell-adb-native/{device_id}' \
--form 'user_token="<Your_User_Token>"' \
--form 'command="<your adb shell command>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/execute-shell-adb-native/{device_id}")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>'],['command', '<your adb shell command>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/execute-shell-adb-native/{device_id}"

payload = {'user_token': '<Your_User_Token>',
'command': '<your adb shell command>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
],
[
'name' => 'command',
'contents' => '<your adb shell command>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/execute-shell-adb-native/{device_id}');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.addFormDataPart("command","<your adb shell command>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/execute-shell-adb-native/{device_id}")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");
formdata.append("command", "<your adb shell command>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/execute-shell-adb-native/{device_id}", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/execute-shell-adb-native/{device_id}"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("command", "<your adb shell command>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/execute-shell-adb-native/{device_id}");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
content.Add(new StringContent("<your adb shell command>"), "command");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
    "success": true,
    "message": "Command executed successfully.",
    "output": "Users:ntUserInfo{0:Owner:4c13} running",
    "file_url": "Command executed successfully."
}

Android Execute Shell ADB Copied!

Executes a shell command (pm list users | grep “New user”) on a remote server specified by the API endpoint.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
command string Required
executes the pm list users | grep "New user" command on the server.
POST /api/execute-shell-adb/3
curl --location 'https://your_domain.testgrid.io/api/execute-shell-adb/3' \
--form 'user_token="<Your_User_Token>"' \
--form 'command="<{\"command\":\"pm\",\"args\":[\"list\",\"users\",\"|\",\"grep\",\"New user\"]}>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/execute-shell-adb/3")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>'],['command', '<{\"command\":\"pm\",\"args\":[\"list\",\"users\",\"|\",\"grep\",\"New user\"]}>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/execute-shell-adb/3"

payload = {'user_token': '<Your_User_Token>',
'command': '<{\"command\":\"pm\",\"args\":[\"list\",\"users\",\"|\",\"grep\",\"New user\"]}>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
],
[
'name' => 'command',
'contents' => '<{\"command\":\"pm\",\"args\":[\"list\",\"users\",\"|\",\"grep\",\"New user\"]}>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/execute-shell-adb/3');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.addFormDataPart("command","<{\"command\":\"pm\",\"args\":[\"list\",\"users\",\"|\",\"grep\",\"New user\"]}>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/execute-shell-adb/3")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");
formdata.append("command", "<{\"command\":\"pm\",\"args\":[\"list\",\"users\",\"|\",\"grep\",\"New user\"]}>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/execute-shell-adb/3", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/execute-shell-adb/3"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("command", "<{\"command\":\"pm\",\"args\":[\"list\",\"users\",\"|\",\"grep\",\"New user\"]}>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/execute-shell-adb/3");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
content.Add(new StringContent("<{\"command\":\"pm\",\"args\":[\"list\",\"users\",\"|\",\"grep\",\"New user\"]}>"), "command");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
"success": true,
"message": "Command executed successfully"
"output": "Users:ntUserInfo{0:Owner:4c13} running"
}

Get All Installed Applications Copied!

This section allows users to retrieve a list of all installed applications for a specific device. By providing the device ID, users can access information about the applications installed on that device, including the user token and bundle ID.

Path Parameters

{device_id} string Required
The unique identifier for the device on which the application is installed.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
POST /api/user/installed-app/{{device_id}}/
curl --location --globoff 'https://your_domain.testgrid.io/api/user/installed-app/{{device_id}}/' \
--form 'user_token="<Your_User_Token>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/user/installed-app/{{device_id}}/")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/user/installed-app/{{device_id}}/"

payload = {'user_token': '<Your_User_Token>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/user/installed-app/{{device_id}}/');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/user/installed-app/{{device_id}}/")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/user/installed-app/{{device_id}}/", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/user/installed-app/{{device_id}}/"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/user/installed-app/{{device_id}}/");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
    "success": true,
    "message": "All installed application.",
    "data": [
        {
            "bundle_id": "com.amazon.mShop.android.shopping",
            "name": "mazon Shopping",
            "version": "28.21.6.100"
        },
        {
            "bundle_id": "Appium Settings",
            "name": "Appium Settings",
            "version": "7.0.4"
        },
        {
            "bundle_id": "com.nationwide.mobile.android.nwmobile",
            "name": "Nationwide",
            "version": "13.5.0"
        }
    ]
}

Uninstall app Copied!

The Uninstall app copy section allows users to initiate the uninstallation process for a specific app on a user’s device. By providing the required parameters, users can seamlessly remove the app from the device, ensuring a streamlined user experience.

Path Parameters

{device_id} string Required
The unique identifier for the device.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
bundle_id string Required
The unique identifier for the app bundle.
POST /api/user/uninstall-app/{{device_id}}/
curl --location --globoff 'https://your_domain.testgrid.io/api/user/uninstall-app/{{device_id}}/' \
--form 'user_token="<Your_User_Token>"' \
--form 'bundle_id="<Your_bundle_id>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/user/uninstall-app/{{device_id}}/")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>'],['bundle_id', '<Your_bundle_id>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/user/uninstall-app/{{device_id}}/"

payload = {'user_token': '<Your_User_Token>',
'bundle_id': '<Your_bundle_id>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
],
[
'name' => 'bundle_id',
'contents' => '<Your_bundle_id>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/user/uninstall-app/{{device_id}}/');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.addFormDataPart("bundle_id","<Your_bundle_id>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/user/uninstall-app/{{device_id}}/")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");
formdata.append("bundle_id", "<Your_bundle_id>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/user/uninstall-app/{{device_id}}/", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/user/uninstall-app/{{device_id}}/"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("bundle_id", "<Your_bundle_id>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/user/uninstall-app/{{device_id}}/");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
content.Add(new StringContent("<Your_bundle_id>"), "bundle_id");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
    "success": true,
    "message": "Request to uninstall application has been sent to the device."
}

Restart Device API Copied!

The Restart Device API section allows users to remotely restart a device within the TestGrid API project. By providing the necessary parameters, users can initiate a restart of a specific device using this API.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
device_id string Required
The ID of the device being restart. Get all devices api will give you the device_id
POST /devicecloud/api/restartDevice
curl --location 'https://your_domain.testgrid.io/devicecloud/api/restartDevice' \
--form 'user_token="<Your_User_Token>"' \
--form 'device_id="<Your_Device_Id>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/devicecloud/api/restartDevice")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>'],['device_id', '<Your_Device_Id>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/devicecloud/api/restartDevice"

payload = {'user_token': '<Your_User_Token>',
'device_id': '<Your_Device_Id>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
],
[
'name' => 'device_id',
'contents' => '<Your_Device_Id>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/devicecloud/api/restartDevice');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.addFormDataPart("device_id","<Your_Device_Id>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/devicecloud/api/restartDevice")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");
formdata.append("device_id", "<Your_Device_Id>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/devicecloud/api/restartDevice", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/devicecloud/api/restartDevice"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("device_id", "<Your_Device_Id>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/devicecloud/api/restartDevice");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
content.Add(new StringContent("<Your_Device_Id>"), "device_id");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
    "status": 1,
    "msg": "The device reboot request has been sent. Please wait for a while."
}

Get Device Details Copied!

This section allows users to retrieve device details by making a request to the TG API GetAppiumCapabilities endpoint. By providing the necessary parameters, users can obtain information about a specific device, such as a user token and UDID or device id, enabling them to perform actions specific to that device within their application. This API either requires UDID or the Device Id to get the device information.

Description:

  • "is_connected": "1" means the device is connected and available online.
  • "is_offline": "1" means the device is in an offline state; the device jar needs to be restarted.
  • "is_device_offline": "1" means the device is offline from ADB and requires physical interaction.
  • "is_unauthorised": "1" means the device is in an unauthorised state and needs physical interaction.
  • "is_rebooting": "1" means the device is currently rebooting.
  • "is_reserved": "1" means the device is reserved by a user.
  • "is_cleaning": "1" means the device is undergoing a cleanup process, which removes apps and browser history.
  • "is_run_generator": "1" means the device is being used in the Test Case Generator.
  • "is_run_build": "1" means a build is currently running on the device.
  • "is_run_local_execution": "1" means a local execution script is running on the device.
  • "is_run_device_cloud": "1" means the device is manually connected to the device cloud.
  • "is_preparing": "1" means the device is in the preparing state after a cleanup process.
  • "is_run_virtual_usb": "1" means the device is connected via virtual USB.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
device_id string Required
The ID of the device to get the information. Get all devices api will give you the device_id
udid string Required
UDID of the device for which we need the information.
POST /devicecloud/api/GetAppiumCapabilities
curl --location 'https://your_domain.testgrid.io/devicecloud/api/GetAppiumCapabilities' \
--form 'user_token="<Your_User_Token>"' \
--form 'device_id="<Your_Device_Id>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/devicecloud/api/GetAppiumCapabilities")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>'],['device_id', '<Your_Device_Id>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/devicecloud/api/GetAppiumCapabilities"

payload = {'user_token': '<Your_User_Token>',
'device_id': '<Your_Device_Id>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
],
[
'name' => 'device_id',
'contents' => '<Your_Device_Id>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/devicecloud/api/GetAppiumCapabilities');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.addFormDataPart("device_id","<Your_Device_Id>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/devicecloud/api/GetAppiumCapabilities")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");
formdata.append("device_id", "<Your_Device_Id>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/devicecloud/api/GetAppiumCapabilities", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/devicecloud/api/GetAppiumCapabilities"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("device_id", "<Your_Device_Id>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/devicecloud/api/GetAppiumCapabilities");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
content.Add(new StringContent("<Your_Device_Id>"), "device_id");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
    "status": 1,
    "msg": "Device details.",
    "data": {
        "device_id": "5",
        "appiumURL": "{URL}",
        "platformName": "iOS",
        "platform_version": "17.2.1",
        "deviceName": "iPhone 12",
        "automationName": "XCUITest",
        "udid": "xxxxxxxxxxxxxx",
        "s_device": "4KMS5L",
        "wdaLocalPort": "3001",
        "is_run_generator": 0,
        "is_run_build": 1,
        "is_run_local_execution": 0,
        "is_run_virtual_usb": 0,
        "is_run_device_cloud": 1,
        "is_offline": 0,
        "is_connected": 1,
        "is_device_offline": 0,
        "is_unauthorised": 0,
        "is_rebooting": 0,
        "is_reserved": 0,
        "is_preparing": 0,
        "is_cleaning": 0,
        "reserved_device_user_email": ""
    }
}

Upload Image for Image Injection Copied!

This section allows users to upload an image for image injection within the TestGrid API project. By providing the necessary parameters, users can seamlessly integrate their desired image into the project without needing to directly specify the method or endpoint path.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
image string Required
The image file to be uploaded. Supported file formats include JPEG, PNG, and GIF.
POST /api/image-integration
curl --location 'https://your_domain.testgrid.io/api/image-integration' \
--form 'user_token="<Your_User_Token>"' \
--form 'image="<Your_Image>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/image-integration")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>'],['image', '<Your_Image>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/image-integration"

payload = {'user_token': '<Your_User_Token>',
'image': '<Your_Image>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
],
[
'name' => 'image',
'contents' => '<Your_Image>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/image-integration');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.addFormDataPart("image","<Your_Image>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/image-integration")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");
formdata.append("image", "<Your_Image>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/image-integration", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/image-integration"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("image", "<Your_Image>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/image-integration");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
content.Add(new StringContent("<Your_Image>"), "image");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
    "success": true,
    "id": "697207bdb19a6"
}

Device Clean up Copied!

The Clean Device API primarily removes unnecessary third-party apps, deletes gallery images, resets various settings, and guest user profiles. After the cleanup process, the device appears as if it has undergone a fresh setup.

For this API, two mandatory parameters must be provided:

  • Device ID (retrieved from the Device List API)
  • User Token

The device ID is passed via the URL and can be found in the UI under the “i” button, which contains this information. Also getting this information response in device list API.

Path Parameters

device_id string Required

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.

Note

Android
Removes third-party apps, - Cleans gallery images. - Removes profiles
iOS
Removes third-party apps only, and gallery image cleanup and profile removal are not supported due to iOS restrictions
POST /api/user/clean-device/{device_id}
curl --location --globoff 'https://your_domain.testgrid.io/api/user/clean-device/{device_id}' \
--form 'user_token="<Your_User_Token>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/user/clean-device/{device_id}")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/user/clean-device/{device_id}"

payload = {'user_token': '<Your_User_Token>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/user/clean-device/{device_id}');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/user/clean-device/{device_id}")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/user/clean-device/{device_id}", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/user/clean-device/{device_id}"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/user/clean-device/{device_id}");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
    "success": true,
    "message": "The device has been cleaned up successfully."
}

Free System Port Copied!

The “Free System Port” API provides an available network port on the host system that can be used for various services. This endpoint is useful when dynamically assigning ports for applications, ensuring that the selected port is not currently in use by other processes.

Path Parameters

device_id string

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
POST /api/free-system-port/{device_id}
curl --location --globoff 'https://your_domain.testgrid.io/api/free-system-port/{device_id}' \
--form 'user_token="<Your_User_Token>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/free-system-port/{device_id}")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/free-system-port/{device_id}"

payload = {'user_token': '<Your_User_Token>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/free-system-port/{device_id}');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/free-system-port/{device_id}")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/free-system-port/{device_id}", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/free-system-port/{device_id}"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/free-system-port/{device_id}");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
    "success": true,
    "message": "System port free successfully."
}

Get Device Analytics Copied!

This section allows users to retrieve all devices analytics within the TestGrid Project.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
team_id string
Put team id here, you can get that from the team list api.
process_server string
Put either 'tc_generator' = 'Test Case Generator' , 'build' = 'Build Run', 'device_cloud' = 'Device Cloud', 'local_execution' = 'Local Execution' as per the user utilization of the device.
filter_date_from string
The date Format: yyyy-MM-dd
filter_date_to string
The date Format: yyyy-MM-dd
page string
You can put values like 1,2,3 etc.
device_id string
You can get this value from get device list api.
pageLimit string
You can put values like 1,2,3 etc.
user_id string
You can get this value from the api user list.
POST /api/get-device-analytics
curl --location 'https://your_domain.testgrid.io/api/get-device-analytics' \
--form 'user_token="<Your_User_Token>"' \
--form 'team_id="<Your_Team_Id>"' \
--form 'process_server="<Your_process_server>"' \
--form 'filter_date_from="<Your_filter_date_from>"' \
--form 'filter_date_to="<Your_filter_date_to>"' \
--form 'page="<Your_page>"' \
--form 'device_id="<Your_Device_Id>"' \
--form 'pageLimit="<Your_pageLimit>"' \
--form 'user_id="<Your_User_Id>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/get-device-analytics")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '"<Your_User_Token>'],['team_id', '<Your_Team_Id>'],['process_server', '<Your_process_server>'],['filter_date_from', '<Your_filter_date_from>'],['filter_date_to', '<Your_filter_date_to>'],['page', '<Your_page>'],['device_id', '<Your_Device_Id>'],['pageLimit', '<Your_pageLimit>'],['user_id', '<Your_User_Id>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/get-device-analytics"

payload = {'user_token': '<Your_User_Token>',
'team_id': '<Your_Team_Id>',
'process_server': '<Your_process_server>',
'filter_date_from': '<Your_filter_date_from>',
'filter_date_to': '<Your_filter_date_to>',
'page': '<Your_page>',
'device_id': '<Your_Device_Id>',
'pageLimit': '<Your_pageLimit>',
'user_id': '<Your_User_Id>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
],
[
'name' => 'team_id',
'contents' => '<Your_Team_Id>'
],
[
'name' => 'process_server',
'contents' => '<Your_Process_Server>'
],
[
'name' => 'filter_date_from',
'contents' => '<Your_Filter_Date_From>'
],
[
'name' => 'filter_date_to',
'contents' => '<Your_Filter_Date_To>'
],
[
'name' => 'page',
'contents' => '<Your_Page>'
],
[
'name' => 'device_id',
'contents' => '<Your_Device_Id>'
],
[
'name' => 'pageLimit',
'contents' => '<Your_PageLimit>'
],
[
'name' => 'user_id',
'contents' => '<Your_User_Id>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/get-device-analytics');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.addFormDataPart("team_id","<Your_Team_Id>")
.addFormDataPart("process_server","<Your_Process_Server>")
.addFormDataPart("filter_date_from","<Your_Filter_Date_From>")
.addFormDataPart("filter_date_to","<Your_Filter_Date_To>")
.addFormDataPart("page","<Your_Page>")
.addFormDataPart("device_id","<Your_Device_Id>")
.addFormDataPart("pageLimit","<Your_PageLimit>")
.addFormDataPart("user_id","<Your_User_Id>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/get-device-analytics")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");
formdata.append("team_id", "<Your_Team_Id>");
formdata.append("process_server", "<Your_Process_Server>");
formdata.append("filter_date_from", "<Your_Filter_Date_From>");
formdata.append("filter_date_to", "<Your_Filter_Date_To>");
formdata.append("page", "<Your_Page>");
formdata.append("device_id", "<Your_Device_Id>");
formdata.append("pageLimit", "<Your_pageLimit>");
formdata.append("user_id", "<Your_User_Id>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/get-device-analytics", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/get-device-analytics"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("team_id", "<Your_Team_Id>")
_ = writer.WriteField("process_server", "<Your_Process_Server>")
_ = writer.WriteField("filter_date_from", "<Your_Filter_Date_From>")
_ = writer.WriteField("filter_date_to", "<Your_Filter_Date_To>")
_ = writer.WriteField("page", "<Your_Page>")
_ = writer.WriteField("device_id", "<Your_Device_Id>")
_ = writer.WriteField("pageLimit", "<Your_PageLimit>")
_ = writer.WriteField("user_id", "<Your_User_Id>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/get-device-analytics");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
content.Add(new StringContent("<Your_Team_Id>"), "team_id");
content.Add(new StringContent("<Your_Process_Server>"), "process_server");
content.Add(new StringContent("<Your_Filter_Date_From>"), "filter_date_from");
content.Add(new StringContent("<Your_Filter_Date_To>"), "filter_date_to");
content.Add(new StringContent("<Your_Page>"), "page");
content.Add(new StringContent("<Your_Device_Id>"), "device_id");
content.Add(new StringContent("<Your_PageLimit>"), "pageLimit");
content.Add(new StringContent("<Your_User_Id>"), "user_id");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
    "success": true,
    "message": "Device analytics data",
    "current_page": "40",
    "total_page": "834",
    "total_record": "8340",
    "data": [
        {
            "device_name": "Chrome-101",
            "UDID": "101",
            "user_name": "Ambrikesh Mishra",
            "process_server": "TestCase Generator",
            "month": "2026-01",
            "startTime": "12:26:14",
            "startDate": "2026-01-08",
            "endTime": "12:43:54",
            "endDate": "2026-01-08",
            "duration": "17m 40s",
            "device_location": "",
            "device_data_room": "",
            "device_data_center": "",
            "mobile_number": "",
            "device_groups": "QA_DeviceGroup",
            "device_last_used_on": "2026-01-22 08:59:51 Europe/London"
        }
    ]
}

Get Browser Downloaded Files Copied!

This API retrieves all files downloaded in a specific browser session by accepting the browser’s device_id. It requires authentication via user token for the request.

Path Parameters

device_id string Required
device_id of the specific browser for which we need to retrieve downloaded files

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
POST /api/user/downloads/{device_id}
curl --location --globoff 'https://your_domain.testgrid.io/api/user/downloads/{device_id}' \
--form 'user_token="<Your_User_Token>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/user/downloads/{device_id}")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/user/downloads/{device_id}"

payload = {'user_token': '<Your_User_Token>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/user/downloads/{device_id}');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/user/downloads/{device_id}")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/user/downloads/{device_id}", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/user/downloads/{device_id}"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/user/downloads/{device_id}");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
"success": true,
"message": "Download files list.",
"data":[ {
"name": "-original-xxxxxxx.webp",
"download_url": "https://your_domain.testgrid.io/secondary_3/browser_downloads.php?action=download&amp;directory=3001&amp;file=-original-xxxxxxx.webp",
"delete_url": "https://your_domain.testgrid.io/api/user/downloads/12?delete=-original-xxxxxxx.webp&amp;user_token=xxxxxxxxxxx",
"datetime": "28 Nov 2025 07:41 PM",
}
]
}

Pin Configuration Copied!

The Pin Configuration section provides users with the ability to access and modify the configuration settings for pins in the TG_API_Documents project. Users can accomplish tasks such as retrieving the current configuration, updating pin settings, and managing pin permissions through this section of the API.

Set PIN Copied!

This section allows users to set a PIN for a specific device in the TestGrid API project. By providing the device’s UDID, the new PIN, and the user’s token, the user can successfully set or update the PIN for the device, ensuring secure access to the project’s documents.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
device_id string Required
The ID of the Device on which we have to set PIN
pin string Required
The personal identification number (PIN) to set for the user.
POST /api/set-pin-api
curl --location 'https://your_domain.testgrid.io/api/set-pin-api' \
--form 'device_id="<Your_Device_ID>"' \
--form 'pin="<Your_pin>"' \
--form 'user_token="<Your_User_Token>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/set-pin-api")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['device_id', '<Your_Device_ID>'],['pin', '<Your_pin>'],['user_token', '<Your_User_Token>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/set-pin-api"

payload = {'device_id': '<Your_Device_ID>',
'pin': '<Your_pin>',
'user_token': '<Your_User_Token>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'device_id',
'contents' => '<Your_Device_ID>'
],
[
'name' => 'pin',
'contents' => '<Your_pin>'
],
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/set-pin-api');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("device_id","<Your_Device_ID>")
.addFormDataPart("pin","<Your_pin>")
.addFormDataPart("user_token","<Your_User_Token>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/set-pin-api")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("device_id", "<Your_Device_ID>");
formdata.append("pin", "<Your_pin>");
formdata.append("user_token", "<Your_User_Token>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/set-pin-api", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/set-pin-api"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("device_id", "<Your_Device_ID>")
_ = writer.WriteField("pin", "<Your_pin>")
_ = writer.WriteField("user_token", "<Your_User_Token>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/set-pin-api");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_Device_ID>"), "device_id");
content.Add(new StringContent("<Your_pin>"), "pin");
content.Add(new StringContent("<Your_User_Token>"), "user_token");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
    "success": 1,
    "message": "Request to set specified device PIN is sent to the server."
}

Remove PIN Copied!

The Remove pin section allows users to remove a pin from a specified device using the TestGrid. By providing the necessary parameters, including the pin, device UDID, and user token, users can easily remove a pin associated with a specific device.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
pin string Required
The pin code to be removed from the device.
device_id string Required
The ID of the Device on which we have to remove PIN
POST /api/remove-pin-api
curl --location 'https://your_domain.testgrid.io/api/remove-pin-api' \
--form 'pin="<Your_pin>"' \
--form 'device_id="<Your_Device_ID>"' \
--form 'user_token="<Your_User_Token>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/remove-pin-api")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['pin', '<Your_pin>'],['device_id', '<Your_Device_ID>'],['user_token', '<Your_User_Token>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/remove-pin-api"

payload = {'pin': '<Your_pin>',
'device_id': '<Your_Device_ID>',
'user_token': '<Your_User_Token>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'pin',
'contents' => '<Your_pin>'
],
[
'name' => 'device_id',
'contents' => '<Your_Device_ID>'
],
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/remove-pin-api');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("pin","<Your_pin>")
.addFormDataPart("device_id","<Your_Device_ID>")
.addFormDataPart("user_token","<Your_User_Token>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/remove-pin-api")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("pin", "<Your_pin>");
formdata.append("device_id", "<Your_Device_ID>");
formdata.append("user_token", "<Your_User_Token>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/remove-pin-api", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/remove-pin-api"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("pin", "<Your_pin>")
_ = writer.WriteField("device_id", "<Your_Device_ID>")
_ = writer.WriteField("user_token", "<Your_User_Token>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/remove-pin-api");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_pin>"), "pin");
content.Add(new StringContent("<Your_Device_ID>"), "device_id");
content.Add(new StringContent("<Your_User_Token>"), "user_token");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
    "success": 1,
    "message": "Request to remove device PIN is sent to the server."
}

Change PIN Copied!

The Change Pin section allows users to securely update their personal identification number (PIN) for accessing the TestGrid API platform. By providing their device UDID, user token, old PIN, and new PIN, users can easily change their PIN to enhance their account security.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
device_id string Required
The ID of the Device on which we have to change PIN
old_pin string Required
The current PIN of the user.
new_pin string Required
The new PIN that the user wants to set.
POST /api/change-pin-api
curl --location 'https://your_domain.testgrid.io/api/change-pin-api' \
--form 'device_id="<Your_Device_ID>"' \
--form 'user_token="<Your_User_Token>"' \
--form 'old_pin="<Your_old_pin>"' \
--form 'new_pin="<Your_new_pin>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/change-pin-api")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['device_id', '<Your_Device_ID>'],['user_token', '<Your_User_Token>'],['old_pin', '<Your_old_pin>'],['new_pin', '<Your_new_pin>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/change-pin-api"

payload = {'device_id': '<Your_Device_ID>',
'user_token': '<Your_User_Token>',
'old_pin': '<Your_old_pin>',
'new_pin': '<Your_new_pin>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'device_id',
'contents' => '<Your_Device_ID>'
],
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
],
[
'name' => 'old_pin',
'contents' => '<Your_old_pin>'
],
[
'name' => 'new_pin',
'contents' => '<Your_new_pin>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/change-pin-api');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("device_id","<Your_Device_ID>")
.addFormDataPart("user_token","<Your_User_Token>")
.addFormDataPart("old_pin","<Your_old_pin>")
.addFormDataPart("new_pin","<Your_new_pin>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/change-pin-api")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("device_id", "<Your_Device_ID>");
formdata.append("user_token", "<Your_User_Token>");
formdata.append("old_pin", "<Your_old_pin>");
formdata.append("new_pin", "<Your_new_pin>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/change-pin-api", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/change-pin-api"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("device_id", "<Your_Device_ID>")
_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("old_pin", "<Your_old_pin>")
_ = writer.WriteField("new_pin", "<Your_new_pin>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/change-pin-api");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_Device_ID>"), "device_id");
content.Add(new StringContent("<Your_User_Token>"), "user_token");
content.Add(new StringContent("<Your_old_pin>"), "old_pin");
content.Add(new StringContent("<Your_new_pin>"), "new_pin");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
    "success": 1,
    "message": "Request to change specified device PIN is sent to the server."
}

Unlock Device Copied!

The Unlock Device section allows users to unlock a device by providing the necessary parameters. Through this functionality, users can grant access to a specific device identified by its UDID, along with the user token and PIN.

Body Parameters

user_token
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
device_id string Required
The ID of the Device on which we want to unlock
pin string Required
The PIN code required to unlock the device.
POST /api/unlock-device-api
curl --location 'https://your_domain.testgrid.io/api/unlock-device-api' \
--form 'device_id="<Your_Device_ID>"' \
--form 'user_token="<Your_User_Token>"' \
--form 'pin="<Your_PIN>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/api/unlock-device-api")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['device_id', '<Your_Device_ID>'],['user_token', '<Your_User_Token>'],['pin', '<Your_PIN>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/api/unlock-device-api"

payload = {'device_id': '<Your_Device_ID>',
'user_token': '<Your_User_Token>',
'pin': '<Your_PIN>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'device_id',
'contents' => '<Your_Device_ID>'
],
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
],
[
'name' => 'pin',
'contents' => '<Your_PIN>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/api/unlock-device-api');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("device_id","<Your_Device_ID>")
.addFormDataPart("user_token","<Your_User_Token>")
.addFormDataPart("pin","<Your_PIN>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/api/unlock-device-api")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("device_id", "<Your_Device_ID>");
formdata.append("user_token", "<Your_User_Token>");
formdata.append("pin", "<Your_PIN>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/api/unlock-device-api", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/api/unlock-device-api"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("device_id", "<Your_Device_ID>")
_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("pin", "<Your_PIN>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/api/unlock-device-api");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_Device_ID>"), "device_id");
content.Add(new StringContent("<Your_User_Token>"), "user_token");
content.Add(new StringContent("<Your_PIN>"), "pin");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
"success": 1,
"message": "Request to unlock device is sent to the server.",
}

Scriptless Execution Copied!

Test Case Details Copied!

The Test case detail section allows users to retrieve detailed information about a specific test case in the TestGrid API project. By providing the necessary parameters, users can access comprehensive details related to the specified test case, enabling them to gather specific information for analysis and debugging purposes.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
application_token string Required
The token used to authenticate the application making the request.
build_test_id string Required
The ID of the build test to retrieve the details for.
test_case_name string Required
The name of the test case to be detailed.
POST /ci/testcase_detail
curl --location 'https://your_domain.testgrid.io/ci/testcase_detail' \
--form 'user_token="<Your_User_Token>"' \
--form 'application_token="<Your_Application_Token>"' \
--form 'build_test_id="<Your_Build_Test_id>"' \
--form 'test_case_name="<Your_Test_Case_Name>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/ci/testcase_detail")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>'],['application_token', '<Your_Application_Token>'],['build_test_id', '<Your_Build_Test_id>'],['test_case_name', '<Your_Test_Case_Name>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/ci/testcase_detail"

payload = {'user_token': '<Your_User_Token>',
'application_token': '<Your_Application_Token>',
'build_test_id': '<Your_Build_Test_id>',
'test_case_name': '<Your_Test_Case_Name>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
],
[
'name' => 'application_token',
'contents' => '<Your_Application_Token>'
],
[
'name' => 'build_test_id',
'contents' => '<Your_Build_Test_id>'
],
[
'name' => 'test_case_name',
'contents' => '<Your_Test_Case_Name>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/ci/testcase_detail');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.addFormDataPart("application_token","<Your_Application_Token>")
.addFormDataPart("build_test_id","<Your_Build_Test_id>")
.addFormDataPart("test_case_name","<Your_Test_Case_Name>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/ci/testcase_detail")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");
formdata.append("application_token", "<Your_Application_Token>");
formdata.append("build_test_id", "<Your_Build_Test_id>");
formdata.append("test_case_name", "<Your_Test_Case_Name>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/ci/testcase_detail", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/ci/testcase_detail"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("application_token", "<Your_Application_Token>")
_ = writer.WriteField("build_test_id", "<Your_Build_Test_id>")
_ = writer.WriteField("test_case_name", "<Your_Test_Case_Name>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/ci/testcase_detail");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
content.Add(new StringContent("<Your_Application_Token>"), "application_token");
content.Add(new StringContent("<Your_Build_Test_id>"), "build_test_id");
content.Add(new StringContent("<Your_Test_Case_Name>"), "test_case_name");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());

Build List Copied!

The Build List section allows users to create a list of builds in the TestGrid project. Users can specify the user token, application token, build number, and the duration in minutes for the last builds to be included in the list. This section enables users to easily manage and track builds within the project.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
application_token string Required
The token that identifies the application.
build_number string
The number assigned to the build.
last_minutes string
The number of minutes since the last build.
POST /ci/build_list
curl --location 'https://your_domain.testgrid.io/ci/build_list' \
--form 'user_token="<Your_User_Token>"' \
--form 'application_token="<Your_Application_token>"' \
--form 'build_number="<Your_build_number>"' \
--form 'last_minutes="<Your_Last_Minutes>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/ci/build_list")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>'],['application_token', '<Your_Application_token>'],['build_number', '<Your_build_number>'],['last_minutes', '<Your_Last_Minutes>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/ci/build_list"

payload = {'user_token': '<Your_User_Token>',
'application_token': '<Your_Application_token>',
'build_number': '<Your_build_number>',
'last_minutes': '<Your_Last_Minutes>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
],
[
'name' => 'application_token',
'contents' => '<Your_Application_token>'
],
[
'name' => 'build_number',
'contents' => '<Your_build_number>'
],
[
'name' => 'last_minutes',
'contents' => '<Your_Last_Minutes>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/ci/build_list');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.addFormDataPart("application_token","<Your_Application_token>")
.addFormDataPart("build_number","<Your_build_number>")
.addFormDataPart("last_minutes","<Your_Last_Minutes>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/ci/build_list")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");
formdata.append("application_token", "<Your_Application_token>");
formdata.append("build_number", "<Your_build_number>");
formdata.append("last_minutes", "<Your_Last_Minutes>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/ci/build_list", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/ci/build_list"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("application_token", "<Your_Application_token>")
_ = writer.WriteField("build_number", "<Your_build_number>")
_ = writer.WriteField("last_minutes", "<Your_Last_Minutes>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/ci/build_list");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
content.Add(new StringContent("<Your_Application_token>"), "application_token");
content.Add(new StringContent("<Your_build_number>"), "build_number");
content.Add(new StringContent("<Your_Last_Minutes>"), "last_minutes");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
"status": 1,
"msg": "List of builds",
"build_list": {
"build_number": "770",
"created": "2025-03-21 10:14:46",
}
}

Update Variable Value Copied!

This section allows users to update the value of a variable associated with a specific test case. By providing the necessary parameters, users can modify the value of a variable, enabling them to customize and fine-tune their test cases within the TestGrid API project.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
version_token string Required
The token to identify the version of the API.
test_case_name string Required
The name of the test case to update.
var_name string Required
The name of the variable to update.
var_value string Required
The new value of the variable.
POST /ci/update_variable_value
curl --location 'https://your_domain.testgrid.io/ci/update_variable_value' \
--form 'user_token="<Your_User_Token>"' \
--form 'version_token="<Your_Version_Token>"' \
--form 'test_case_name="<Your_Test_Case_name>"' \
--form 'var_name="<Your_Var_Name>"' \
--form 'var_value="<Your_Var_Value>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/ci/update_variable_value")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>'],['version_token', '<Your_Version_Token>'],['test_case_name', '<Your_Test_Case_name>'],['var_name', '<Your_Var_Name>'],['var_value', '<Your_Var_Value>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/ci/update_variable_value"

payload = {'user_token': '<Your_User_Token>',
'version_token': '<Your_Version_Token>',
'test_case_name': '<Your_Test_Case_name>',
'var_name': '<Your_Var_Name>',
'var_value': '<Your_Var_Value>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
],
[
'name' => 'version_token',
'contents' => '<Your_Version_Token>'
],
[
'name' => 'test_case_name',
'contents' => '<Your_Test_Case_name>'
],
[
'name' => 'var_name',
'contents' => '<Your_Var_Name>'
],
[
'name' => 'var_value',
'contents' => '<Your_Var_Value>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/ci/update_variable_value');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.addFormDataPart("version_token","<Your_Version_Token>")
.addFormDataPart("test_case_name","<Your_Test_Case_name>")
.addFormDataPart("var_name","<Your_Var_Name>")
.addFormDataPart("var_value","<Your_Var_Value>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/ci/update_variable_value")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");
formdata.append("version_token", "<Your_Version_Token>");
formdata.append("test_case_name", "<Your_Test_Case_name>");
formdata.append("var_name", "<Your_Var_Name>");
formdata.append("var_value", "<Your_Var_Value>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/ci/update_variable_value", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/ci/update_variable_value"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("version_token", "<Your_Version_Token>")
_ = writer.WriteField("test_case_name", "<Your_Test_Case_name>")
_ = writer.WriteField("var_name", "<Your_Var_Name>")
_ = writer.WriteField("var_value", "<Your_Var_Value>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/ci/update_variable_value");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
content.Add(new StringContent("<Your_Version_Token>"), "version_token");
content.Add(new StringContent("<Your_Test_Case_name>"), "test_case_name");
content.Add(new StringContent("<Your_Var_Name>"), "var_name");
content.Add(new StringContent("<Your_Var_Value>"), "var_value");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());

Execution Details Copied!

The Execution Detail section allows users to retrieve detailed information about the execution of a specific task within the TestGrid project. By providing the necessary parameters, users can access important data such as user and application tokens, as well as the build number associated with the execution.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
application_token string Required
The unique token associated with the application.
build_number string Required
The number representing the build version of the application.

Response Status

"is_completed :"

  • 1 – Processing: Test execution is currently in progress.
  • 2 – Queued: Test execution is waiting in the queue to start.
  • 3 – Completed: Test execution has finished successfully.
  • 4 – Stopped: Test execution is manually stopped before completion.

"test_status :"

  • 0 – Not Started: Test execution has not started yet.
  • 1 – Started: Test execution has started and is currently running.
  • 2 – Pass: Test execution completed successfully and passed.
  • 3 – Fail: Test execution completed with one or more failures.
  • 4 – Stopped: Test execution is stopped before completion.
  • Others – Skipped: Test execution is skipped.
POST /ci/execution_detail
curl --location 'https://your_domain.testgrid.io/ci/execution_detail' \
--form 'user_token="<Your_User_Token>"' \
--form 'application_token="<Your_Application_token>"' \
--form 'build_number="<Your_build_number>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/ci/execution_detail")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>'],['application_token', '<Your_Application_token>'],['build_number', '<Your_build_number>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/ci/execution_detail"

payload = {'user_token': '<Your_User_Token>',
'application_token': '<Your_Application_token>',
'build_number': '<Your_build_number>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
],
[
'name' => 'application_token',
'contents' => '<Your_Application_token>'
],
[
'name' => 'build_number',
'contents' => '<Your_build_number>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/ci/execution_detail');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.addFormDataPart("application_token","<Your_Application_token>")
.addFormDataPart("build_number","<Your_build_number>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/ci/execution_detail")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");
formdata.append("application_token", "<Your_Application_token>");
formdata.append("build_number", "<Your_build_number>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/ci/execution_detail", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/ci/execution_detail"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("application_token", "<Your_Application_token>")
_ = writer.WriteField("build_number", "<Your_build_number>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/ci/execution_detail");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
content.Add(new StringContent("<Your_Application_token>"), "application_token");
content.Add(new StringContent("<Your_build_number>"), "build_number");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
"status": 1,
"msg": "execution detail of build",
"is_build_completed_in_all_devices": "1",
"build_number": "768",
"build_url": "https://your_domain.testgrid.io/build/apps/4206",
"build_devices":[ {
"build_test_id": "770",
"device_id": "2025-03-21 10:14:46",
"device_name": "770",
"no_of_not_started": "2025-03-21 10:14:46",
"no_of_started": "770",
"no_of_pass": "2025-03-21 10:14:46",
"no_of_fail": "770",
"no_of_stopped": "2025-03-21 10:14:46",
"no_of_skipped": "770",
"test_cases":[ {
"build_module_id": "770",
"test_case_name": "2025-03-21 10:14:46",
"is_network_assert": "770",
"parameterised_test_data": "2025-03-21 10:14:46",
"test_status": "770",
"failed_reason": "2025-03-21 10:14:46",
}
],
"info": {
"app_version": "770",
"app_build_number": "2025-03-21 10:14:46",
"bundle_id": "770",
"device_name": "2025-03-21 10:14:46",
"device_rom": "770",
"device_ram": "2025-03-21 10:14:46",
"device_processor_name": "770",
"device_battary_capacity": "2025-03-21 10:14:46",
},
"is_completed": 1,
}
]
}

Network Logs Copied!

The Network log section of the TestGrid project allows users to submit network log data for analysis. By providing the necessary parameters, such as user and application tokens, along with the build test ID, users can effectively contribute to network troubleshooting and improve application performance.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
application_token string Required
The unique token assigned to the application.
build_test_id string Required
The ID of the build test.
POST /ci/networklog
curl --location 'https://your_domain.testgrid.io/ci/networklog' \
--form 'user_token="<Your_User_Token>"' \
--form 'application_token="<Your_Application_token>"' \
--form 'build_test_id="<Your_build_test_id>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/ci/networklog")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>'],['application_token', '<Your_Application_token>'],['build_test_id', '<Your_build_test_id>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/ci/networklog"

payload = {'user_token': '<Your_User_Token>',
'application_token': '<Your_Application_token>',
'build_test_id': '<Your_build_test_id>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
],
[
'name' => 'application_token',
'contents' => '<Your_Application_token>'
],
[
'name' => 'build_test_id',
'contents' => '<Your_build_test_id>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/ci/networklog');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.addFormDataPart("application_token","<Your_Application_token>")
.addFormDataPart("build_test_id","<Your_build_test_id>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/ci/networklog")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");
formdata.append("application_token", "<Your_Application_token>");
formdata.append("build_test_id", "<Your_build_test_id>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/ci/networklog", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/ci/networklog"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("application_token", "<Your_Application_token>")
_ = writer.WriteField("build_test_id", "<Your_build_test_id>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/ci/networklog");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
content.Add(new StringContent("<Your_Application_token>"), "application_token");
content.Add(new StringContent("<Your_build_test_id>"), "build_test_id");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
"status": 1,
"msg": "Network Log",
"data":[ {
"id": "1",
"url": "https://play.googleapis.com",
"status": "COMPLETE",
"responsecode": "200",
"protocol": "https",
"method": "CONNECT",
"contenttype": "",
"requeststarttime": "1742384751.538",
"requestendtime": "1742384751.538",
"responsestarttime": "1742384751.538",
"responseendtime": "0",
"duration": "0",
"requestheadersize": "0",
"requestbodysize": "17187",
"responseheadersize": "0",
"responsebodysize": "2377",
"responsedata": "https://your_domain.testgrid.io/demo2.testgrid.io//process/fd/xxxxx.txt",
"testcase_name": "t01searchatlantalocation",
"step_name": "",
"step_no": "",
},
]
}

Insights Data Copied!

The Insights section of the TestGrid allows users to retrieve valuable data and analytics related to their application’s tests and test cases. By leveraging this section, users can gain insights into the performance and results of their test cases, enabling them to make informed decisions and improvements to their application’s quality assurance processes.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
application_token string Required
The unique token assigned to the application.
build_test_id string Required
The ID of the build test.
test_case_name string Required
The name of the test case.
POST /ci/Insights
curl --location 'https://your_domain.testgrid.io/ci/Insights' \
--form 'user_token="<Your_User_Token>"' \
--form 'application_token="<Your_Application_Token>"' \
--form 'build_test_id="<Your_build_test_id>"' \
--form 'test_case_name="<Your_test_case_name>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/ci/Insights")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>'],['application_token', '<Your_Application_Token>'],['build_test_id', '<Your_build_test_id>'],['test_case_name', '<Your_test_case_name>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/ci/Insights"

payload = {'user_token': '<Your_User_Token>',
'application_token': '<Your_Application_Token>',
'build_test_id': '<Your_build_test_id>',
'test_case_name': '<Your_test_case_name>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
],
[
'name' => 'application_token',
'contents' => '<Your_Application_Token>'
],
[
'name' => 'build_test_id',
'contents' => '<Your_build_test_id>'
],
[
'name' => 'test_case_name',
'contents' => '<Your_test_case_name>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/ci/Insights');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.addFormDataPart("application_token","<Your_Application_Token>")
.addFormDataPart("build_test_id","<Your_build_test_id>")
.addFormDataPart("test_case_name","<Your_test_case_name>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/ci/Insights")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");
formdata.append("application_token", "<Your_Application_Token>");
formdata.append("build_test_id", "<Your_build_test_id>");
formdata.append("test_case_name", "<Your_test_case_name>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/ci/Insights", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/ci/Insights"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("application_token", "<Your_Application_Token>")
_ = writer.WriteField("build_test_id", "<Your_build_test_id>")
_ = writer.WriteField("test_case_name", "<Your_test_case_name>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/ci/Insights");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
content.Add(new StringContent("<Your_Application_Token>"), "application_token");
content.Add(new StringContent("<Your_build_test_id>"), "build_test_id");
content.Add(new StringContent("<Your_test_case_name>"), "test_case_name");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
"status": 1,
"msg": "Insight data of test case",
"test_case_name": "t01searchatlantalocation",
"insight_data":[ {
"display_time": "2025-03-19 11:45:50.0",
"cpu_val": "3.0",
"memory_val": "163577856",
},
{
"display_time": "2025-03-19 11:45:51.0",
"cpu_val": "2.0",
"memory_val": "163577856",
},
{
"display_time": "2025-03-19 11:45:52.0",
"cpu_val": "6.0",
"memory_val": "163577856",
}
]
}

Transaction Analysis Copied!

The Transaction Analysis section of the TestGrid project enables users to analyze transactions for a given user and application. By providing the necessary tokens and test ID, users can gain valuable insights and detailed analysis of specific transactions, To representing Benchmarking KPIs involves measuring and assessing a business’s performance against predefined benchmarks. Provides the ultimate reassurance that an apps Data Analytics The insights into their relative performance, identify areas for improvement, and set realistic targets for their KPIs.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
application_token string Required
The token used to authenticate the application.
build_test_id string Required
The ID of the build test.
POST /ci/transaction_analysis
curl --location 'https://your_domain.testgrid.io/ci/transaction_analysis' \
--form 'user_token="<Your_User_Token>"' \
--form 'application_token="<Your_Application_Token>"' \
--form 'build_test_id="<Your_build_test_id>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/ci/transaction_analysis")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>'],['application_token', '<Your_Application_Token>'],['build_test_id', '<Your_build_test_id>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/ci/transaction_analysis"

payload = {'user_token': '<Your_User_Token>',
'application_token': '<Your_Application_Token>',
'build_test_id': '<Your_build_test_id>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
],
[
'name' => 'application_token',
'contents' => '<Your_Application_Token>'
],
[
'name' => 'build_test_id',
'contents' => '<Your_build_test_id>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/ci/transaction_analysis');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.addFormDataPart("application_token","<Your_Application_Token>")
.addFormDataPart("build_test_id","<Your_build_test_id>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/ci/transaction_analysis")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");
formdata.append("application_token", "<Your_Application_Token>");
formdata.append("build_test_id", "<Your_build_test_id>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/ci/transaction_analysis", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/ci/transaction_analysis"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("application_token", "<Your_Application_Token>")
_ = writer.WriteField("build_test_id", "<Your_build_test_id>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/ci/transaction_analysis");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
content.Add(new StringContent("<Your_Application_Token>"), "application_token");
content.Add(new StringContent("<Your_build_test_id>"), "build_test_id");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
    "status": 1,
    "msg": "Transcation detail",
    "detailed_analysis_data": []
}

Execution Details by Tags Copied!

The Execution detail by tags section of the TestGrid project allows users to retrieve detailed execution information based on specific tags. Users can effectively filter and analyze execution details by tags, providing a more granular view of their data.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
application_token string Required
The unique token for the application.
tags string Required
A list of tags associated with the execution detail.
POST /ci/execution_detail_by_tags
curl --location 'https://your_domain.testgrid.io/ci/execution_detail_by_tags' \
--form 'user_token="<Your_User_Token>"' \
--form 'application_token="<Your_Application_Token>"' \
--form 'tags="<Your_Tags>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/ci/execution_detail_by_tags")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>'],['application_token', '<Your_Application_Token>'],['tags', '<Your_Tags>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/ci/execution_detail_by_tags"

payload = {'user_token': '<Your_User_Token>',
'application_token': '<Your_Application_Token>',
'tags': '<Your_Tags>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
],
[
'name' => 'application_token',
'contents' => '<Your_Application_Token>'
],
[
'name' => 'tags',
'contents' => '<Your_Tags>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/ci/execution_detail_by_tags');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.addFormDataPart("application_token","<Your_Application_Token>")
.addFormDataPart("tags","<Your_Tags>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/ci/execution_detail_by_tags")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");
formdata.append("application_token", "<Your_Application_Token>");
formdata.append("tags", "<Your_Tags>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/ci/execution_detail_by_tags", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/ci/execution_detail_by_tags"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("application_token", "<Your_Application_Token>")
_ = writer.WriteField("tags", "<Your_Tags>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/ci/execution_detail_by_tags");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
content.Add(new StringContent("<Your_Application_Token>"), "application_token");
content.Add(new StringContent("<Your_Tags>"), "tags");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());

App Build Run [CI] Copied!

The App build run section allows users to initiate the execution of an application build. By providing the necessary parameters, such as user and application tokens, version information, and device specifications, users can trigger the build process without directly specifying the method or endpoint path.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
application_token string Required
The token representing the application in which the app build will run.
version_token string Required
The token representing the version of the app build.
version_module_id string Required
The ID of the version module used in the app build.
s_device string Required
The device on which the app build will run. This can be an iOS or Android device.
process_type string Required
For the process_type endpoint, please use "oaa" for Android, "oia" for iOS, and "ow" for Web applications.
app_build_id string Required
The ID of the app build to be executed.
bundle_identifier string
The unique identifier for the app bundle.
test_website_url string
The URL of the website to be tested during the app build run.
is_launch_with_tgconnect string

Allows you to execute your test cases by securely connecting your local machine to TestGrid devices for testing.

TG Connect Configuration (is_launch_with_tgconnect):

  • 1 → Enable TG Connect
  • 0 → Disable TG Connect
selected_testcase_id string
Comma seperated list of Test case Ids
is_resign_ios_ipa string
Set to 1 to enable iOS IPA resigning during IPA installation.
tags string
List of Tag name assigned for the Test cases we like to execute seperated by comma
POST /ci/app_build_run
curl --location 'https://your_domain.testgrid.io/ci/app_build_run' \
--form 'user_token="<Your_User_Token>"' \
--form 'application_token="<Your_Application_Token>"' \
--form 'version_token="<Your_Version_Token>"' \
--form 'version_module_id="<Your_Version_module>"' \
--form 's_device="<Your_s_device>"' \
--form 'process_type="<Your_Process_Type>"' \
--form 'app_build_id="<Your_App_Build_id>"' \
--form 'bundle_identifier="<Your_bundle_identifier>"' \
--form 'test_website_url="<The URL of the website to be tested during the app build run>"' \
--form 'is_launch_with_tgconnect="<To execute your test cases by securely connecting your local machine to Test Grid devices>"' \
--form 'selected_testcase_id="<Test case Ids for the Test we like to execute>"' \
--form 'is_resign_ios_ipa="<Set to 1 to enable iOS IPA resigning during IPA Installation>"' \
--form 'tags="<Tags assigned for the Test cases we like to execute>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/ci/app_build_run")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['user_token', '<Your_User_Token>'],['application_token', '<Your_Application_Token>'],['version_token', '<Your_Version_Token>'],['version_module_id', '<Your_Version_module>'],['s_device', '<Your_s_device>'],['process_type', '<Your_Process_Type>'],['app_build_id', '<Your_App_Build_id>'],['bundle_identifier', '<Your_bundle_identifier>'],['test_website_url', '<Tags assigned for the Test cases we like to execute>'],['selected_testcase_id', '<Test case Ids for the Test we like to execute>'],['tags', '<Tags assigned for the Test cases we like to execute>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/ci/app_build_run"

payload = {'user_token': '<Your_User_Token>',
'application_token': '<Your_Application_Token>',
'version_token': '<Your_Version_Token>',
'version_module_id': '<Your_Version_module>',
's_device': '<Your_s_device>',
'process_type': '<Your_Process_Type>',
'app_build_id': '<Your_App_Build_id>',
'bundle_identifier': '<Your_bundle_identifier>',
'test_website_url': '<The URL of the website to be tested during the app build run>',
'selected_testcase_id': '<Test case Ids for the Test we like to execute>',
'tags': '<Tags assigned for the Test cases we like to execute>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'user_token',
'contents' => '<Your_User_Token>'
],
[
'name' => 'application_token',
'contents' => '<Your_Application_Token>'
],
[
'name' => 'version_token',
'contents' => '<Your_Version_Token>'
],
[
'name' => 'version_module_id',
'contents' => '<Your_Version_module>'
],
[
'name' => 's_device',
'contents' => '<Your_s_device>'
],
[
'name' => 'process_type',
'contents' => '<Your_Process_Type>'
],
[
'name' => 'app_build_id',
'contents' => '<Your_App_Build_id>'
],
[
'name' => 'bundle_identifier',
'contents' => '<Your_bundle_identifier>'
],
[
'name' => 'test_website_url',
'contents' => '<The URL of the website to be tested during the app build run>'
],
[
'name' => 'selected_testcase_id',
'contents' => '<Test case Ids for the Test we like to execute>'
],
[
'name' => 'tags',
'contents' => '<Tags assigned for the Test cases we like to execute>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/ci/app_build_run');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("user_token","<Your_User_Token>")
.addFormDataPart("application_token","<Your_Application_Token>")
.addFormDataPart("version_token","<Your_Version_Token>")
.addFormDataPart("version_module_id","<Your_Version_module>")
.addFormDataPart("s_device","<Your_s_device>")
.addFormDataPart("process_type","<Your_Process_Type>")
.addFormDataPart("app_build_id","<Your_App_Build_id>")
.addFormDataPart("bundle_identifier","<Your_bundle_identifier>")
.addFormDataPart("test_website_url","<The URL of the website to be tested during the app build run>")
.addFormDataPart("selected_testcase_id","<Test case Ids for the Test we like to execute>")
.addFormDataPart("tags","<Tags assigned for the Test cases we like to execute>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/ci/app_build_run")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("user_token", "<Your_User_Token>");
formdata.append("application_token", "<Your_Application_Token>");
formdata.append("version_token", "<Your_Version_Token>");
formdata.append("version_module_id", "<Your_Version_module>");
formdata.append("s_device", "<Your_s_device>");
formdata.append("process_type", "<Your_Process_Type>");
formdata.append("app_build_id", "<Your_App_Build_id>");
formdata.append("bundle_identifier", "<Your_bundle_identifier>");
formdata.append("test_website_url", "<The URL of the website to be tested during the app build run>");
formdata.append("selected_testcase_id", "<Test case Ids for the Test we like to execute>");
formdata.append("tags", "<Tags assigned for the Test cases we like to execute>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/ci/app_build_run", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/ci/app_build_run"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("user_token", "<Your_User_Token>")
_ = writer.WriteField("application_token", "<Your_Application_Token>")
_ = writer.WriteField("version_token", "<Your_Version_Token>")
_ = writer.WriteField("version_module_id", "<Your_Version_module>")
_ = writer.WriteField("s_device", "<Your_s_device>")
_ = writer.WriteField("process_type", "<Your_Process_Type>")
_ = writer.WriteField("app_build_id", "<Your_App_Build_id>")
_ = writer.WriteField("bundle_identifier", "<Your_bundle_identifier>")
_ = writer.WriteField("test_website_url", "<The URL of the website to be tested during the app build run>")
_ = writer.WriteField("selected_testcase_id", "<Test case Ids for the Test we like to execute>")
_ = writer.WriteField("tags", "<Tags assigned for the Test cases we like to execute>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/ci/app_build_run");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_User_Token>"), "user_token");
content.Add(new StringContent("<Your_Application_Token>"), "application_token");
content.Add(new StringContent("<Your_Version_Token>"), "version_token");
content.Add(new StringContent("<Your_Version_module>"), "version_module_id");
content.Add(new StringContent("<Your_s_device>"), "s_device");
content.Add(new StringContent("<Your_Process_Type>"), "process_type");
content.Add(new StringContent("<Your_App_Build_id>"), "app_build_id");
content.Add(new StringContent("<Your_bundle_identifier>"), "bundle_identifier");
content.Add(new StringContent("<The URL of the website to be tested during the app build run>"), "test_website_url");
content.Add(new StringContent("<Test case Ids for the Test we like to execute>"), "selected_testcase_id");
content.Add(new StringContent("<Tags assigned for the Test cases we like to execute>"), "tags");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
    "status": true,
    "msg": "Successfully upload build",
    "build_id": 3506,
    "build_version": 6
}

Utility Copied!

JSON Upload Copied!

The Json upload section allows users to upload JSON content to the TestGrid API project. By utilising this feature, users can easily add or update JSON files within the project, streamlining their document management process.

Body Parameters

json_content string Required
The JSON content to be uploaded.
existing_file string Required
The name of an existing file that the uploaded JSON content will be merged into.
upload_file string Required
The file to be uploaded in JSON format.
POST /ci/json_upload
curl --location 'https://your_domain.testgrid.io/ci/json_upload' \
--form 'json_content="<Your_json_content>"' \
--form 'existing_file="<Your_existing_file>"' \
--form 'upload_file="<Your_upload_file>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/ci/json_upload")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['json_content', '<Your_json_content>'],['existing_file', '<Your_existing_file>'],['upload_file', '<Your_upload_file>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/ci/json_upload"

payload = {'json_content': '<Your_json_content>',
'existing_file': '<Your_existing_file>',
'upload_file': '<Your_upload_file>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'json_content',
'contents' => '<Your_json_content>'
],
[
'name' => 'existing_file',
'contents' => '<Your_existing_file>'
],
[
'name' => 'upload_file',
'contents' => '<Your_upload_file>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/ci/json_upload');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("json_content","<Your_json_content>")
.addFormDataPart("existing_file","<Your_existing_file>")
.addFormDataPart("upload_file","<Your_upload_file>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/ci/json_upload")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("json_content", "<Your_json_content>");
formdata.append("existing_file", "<Your_existing_file>");
formdata.append("upload_file", "<Your_upload_file>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/ci/json_upload", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/ci/json_upload"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("json_content", "<Your_json_content>")
_ = writer.WriteField("existing_file", "<Your_existing_file>")
_ = writer.WriteField("upload_file", "<Your_upload_file>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/ci/json_upload");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_json_content>"), "json_content");
content.Add(new StringContent("<Your_existing_file>"), "existing_file");
content.Add(new StringContent("<Your_upload_file>"), "upload_file");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
    "status": 1,
    "msg": "JSON UPLOAD",
    "data": "https://your_domain.testgrid.io/s/csv-to-json/20260207/tp65jx.json",
    "local": "http://xxx.xxx.x.xx/s/csv-to-json/20260207/tp65jx.json"
}

CSV to JSON Copied!

The CSV to JSON section allows users to convert CSV files to JSON format. This functionality enables easy transformation of data for easier analysis and integration into various applications.

Body Parameters

csv_content string Required
The content of the CSV file to be converted to JSON.
existing_file string Required
The name of an existing JSON file to append the converted JSON data to.
upload_file string Required
The CSV file to be uploaded and converted to JSON.
POST /ci/csv_to_json
curl --location 'https://your_domain.testgrid.io/ci/csv_to_json' \
--form 'csv_content="<Your_csv_content>"' \
--form 'existing_file="<Your_existing_file>"' \
--form 'upload_file="<Your_upload_file>"'
require "uri"
require "net/http"

url = URI("https://your_domain.testgrid.io/ci/csv_to_json")

https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true

request = Net::HTTP::Post.new(url)
form_data = [['csv_content', '<Your_csv_content>'],['existing_file', '<Your_existing_file>'],['upload_file', '<Your_upload_file>']]
request.set_form form_data, 'multipart/form-data'
response = https.request(request)
puts response.read_body
import requests

url = "https://your_domain.testgrid.io/ci/csv_to_json"

payload = {'csv_content': '<Your_csv_content>',
'existing_file': '<Your_existing_file>',
'upload_file': '<Your_upload_file>'}
files=[

]
headers = {}

response = requests.request("POST", url, headers=headers, data=payload, files=files)

print(response.text)
<?php
$client = new Client();
$options = [
'multipart' => [
[
'name' => 'csv_content',
'contents' => '<Your_csv_content>'
],
[
'name' => 'existing_file',
'contents' => '<Your_existing_file>'
],
[
'name' => 'upload_file',
'contents' => '<Your_upload_file>'
]
]];
$request = new Request('POST', 'https://your_domain.testgrid.io/ci/csv_to_json');
$res = $client->sendAsync($request, $options)->wait();
echo $res->getBody();
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = new MultipartBody.Builder().setType(MultipartBody.FORM)
.addFormDataPart("csv_content","<Your_csv_content>")
.addFormDataPart("existing_file","<Your_existing_file>")
.addFormDataPart("upload_file","<Your_upload_file>")
.build();
Request request = new Request.Builder()
.url("https://your_domain.testgrid.io/ci/csv_to_json")
.method("POST", body)
.build();
Response response = client.newCall(request).execute();
var formdata = new FormData();
formdata.append("csv_content", "<Your_csv_content>");
formdata.append("existing_file", "<Your_existing_file>");
formdata.append("upload_file", "<Your_upload_file>");

var requestOptions = {
method: 'POST',
body: formdata,
redirect: 'follow'
};

fetch("https://your_domain.testgrid.io/ci/csv_to_json", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
package main

import (
"fmt"
"bytes"
"mime/multipart"
"net/http"
"io/ioutil"
)

func main() {

url := "https://your_domain.testgrid.io/ci/csv_to_json"
method := "POST"

payload := &bytes.Buffer{}
writer := multipart.NewWriter(payload)
_ = writer.WriteField("csv_content", "<Your_csv_content>")
_ = writer.WriteField("existing_file", "<Your_existing_file>")
_ = writer.WriteField("upload_file", "<Your_upload_file>")
err := writer.Close()
if err != nil {
fmt.Println(err)
return
}

client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)

if err != nil {
fmt.Println(err)
return
}
req.Header.Set("Content-Type", writer.FormDataContentType())
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()

body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://your_domain.testgrid.io/ci/csv_to_json");
var content = new MultipartFormDataContent();
content.Add(new StringContent("<Your_csv_content>"), "csv_content");
content.Add(new StringContent("<Your_existing_file>"), "existing_file");
content.Add(new StringContent("<Your_upload_file>"), "upload_file");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
Response
{
    "status": 1,
    "msg": "CSV TO JSON",
    "data": "https://your_domain.testgrid.io/s/csv-to-json/20260207/rqZWdE.json",
    "local": "http://xxx.xxx.x.xx/s/csv-to-json/20260207/rqZWdE.json"
}

Enable TG-connect on the device Copied!

TG Connect activation and deactivation is managed entirely through API by passing 1 (active) or 0 (inactive), without requiring any manual interaction on the connected device.

Body Parameters

user_token string Required
The unique authentication token for the user. Refer to https://testgrid.io/docs/document/how-to-get-the-user-token-on-testgrid-platform/ to obtain your user token.
active integer Required
Specifies the TG Connect status for the device.
1 → Activates TG Connect
0 → Deactivates TG Connect
device_id string Required
The unique identifier of the device for which TG Connect needs to be enabled or disabled.
POST /api/tg-connect/{{device_id}}
curl --location 'https://your_domain.testgrid.io/api/tg-connect/{{device_id}}' \
--form 'user_token="{{user_token}}"' \
--form 'active="1"'
Response
{
    "success": true,
    "message": "VPN connected successfully."
}