JavaScript
import Mobilerun from '@mobilerun/sdk';
const client = new Mobilerun({
apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
});
const response = await client.tasks.sendMessage('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
message: 'x',
});
console.log(response.sent);import os
from mobilerun_sdk import Mobilerun
client = Mobilerun(
api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"), # This is the default and can be omitted
)
response = client.tasks.send_message(
task_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
message="x",
)
print(response.sent)package main
import (
"context"
"fmt"
"github.com/stainless-sdks/droidrun-cloud-go"
"github.com/stainless-sdks/droidrun-cloud-go/option"
)
func main() {
client := mobileruncloud.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.Tasks.SendMessage(
context.TODO(),
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
mobileruncloud.TaskSendMessageParams{
Message: "x",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Sent)
}mobilerun-cloud tasks send-message \
--api-key 'My API Key' \
--task-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \
--message xcurl --request POST \
--url https://api.mobilerun.ai/tasks/{task_id}/message \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"message": "<string>"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mobilerun.ai/tasks/{task_id}/message",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'message' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.mobilerun.ai/tasks/{task_id}/message")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mobilerun.ai/tasks/{task_id}/message")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"message\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"sent": true
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"errors": [
"<unknown>"
]
}{
"title": "Unauthorized",
"status": 401,
"detail": "You are not authorized to access this resource",
"errors": []
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"errors": [
"<unknown>"
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"errors": [
"<unknown>"
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"errors": [
"<unknown>"
]
}Tasks
Send Message
Send a message to a running agent task. The message ID is delivered via SSE (UserMessageEvent with action=queued).
POST
/
tasks
/
{task_id}
/
message
JavaScript
import Mobilerun from '@mobilerun/sdk';
const client = new Mobilerun({
apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
});
const response = await client.tasks.sendMessage('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
message: 'x',
});
console.log(response.sent);import os
from mobilerun_sdk import Mobilerun
client = Mobilerun(
api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"), # This is the default and can be omitted
)
response = client.tasks.send_message(
task_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
message="x",
)
print(response.sent)package main
import (
"context"
"fmt"
"github.com/stainless-sdks/droidrun-cloud-go"
"github.com/stainless-sdks/droidrun-cloud-go/option"
)
func main() {
client := mobileruncloud.NewClient(
option.WithAPIKey("My API Key"),
)
response, err := client.Tasks.SendMessage(
context.TODO(),
"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
mobileruncloud.TaskSendMessageParams{
Message: "x",
},
)
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", response.Sent)
}mobilerun-cloud tasks send-message \
--api-key 'My API Key' \
--task-id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e \
--message xcurl --request POST \
--url https://api.mobilerun.ai/tasks/{task_id}/message \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"message": "<string>"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mobilerun.ai/tasks/{task_id}/message",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'message' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.post("https://api.mobilerun.ai/tasks/{task_id}/message")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"message\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mobilerun.ai/tasks/{task_id}/message")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"message\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"sent": true
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"errors": [
"<unknown>"
]
}{
"title": "Unauthorized",
"status": 401,
"detail": "You are not authorized to access this resource",
"errors": []
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"errors": [
"<unknown>"
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"errors": [
"<unknown>"
]
}{
"title": "<string>",
"status": 123,
"detail": "<string>",
"errors": [
"<unknown>"
]
}Authorizations
Bearer token via Authorization header
Path Parameters
Body
application/json
Message to send to the running agent
Required string length:
1 - 4000000Response
Successful Response
Whether the message was queued for delivery
Was this page helpful?
⌘I