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.messages.conversations.markRead({
peerKey: 'x',
upToMessageId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
upToOccurredAt: '2019-12-27T18:11:19.117Z',
});
console.log(response.data);import os
from datetime import datetime
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.messages.conversations.mark_read(
peer_key="x",
up_to_message_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
up_to_occurred_at=datetime.fromisoformat("2019-12-27T18:11:19.117"),
)
print(response.data)curl --request POST \
--url https://api.mobilerun.ai/v1/numbers/messages/conversations/read \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"peerKey": "<string>",
"upToMessageId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"upToOccurredAt": "2023-11-07T05:31:56Z"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mobilerun.ai/v1/numbers/messages/conversations/read",
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([
'peerKey' => '<string>',
'upToMessageId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'upToOccurredAt' => '2023-11-07T05:31:56Z'
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mobilerun.ai/v1/numbers/messages/conversations/read"
payload := strings.NewReader("{\n \"peerKey\": \"<string>\",\n \"upToMessageId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"upToOccurredAt\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.mobilerun.ai/v1/numbers/messages/conversations/read")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"peerKey\": \"<string>\",\n \"upToMessageId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"upToOccurredAt\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mobilerun.ai/v1/numbers/messages/conversations/read")
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 \"peerKey\": \"<string>\",\n \"upToMessageId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"upToOccurredAt\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"updated": 1
}
}{
"message": "<string>",
"reason": "not_installed",
"success": false
}Messages
Mark a conversation's inbound messages read up to a cursor
Marks the caller’s own inbound messages in a conversation thread as read, up to and including the given (upToOccurredAt, upToMessageId) cursor — typically a conversation row’s lastMessage. Idempotent: repeating the call with the same cursor updates 0 rows. Returns the number of rows updated.
POST
/
numbers
/
messages
/
conversations
/
read
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.messages.conversations.markRead({
peerKey: 'x',
upToMessageId: '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
upToOccurredAt: '2019-12-27T18:11:19.117Z',
});
console.log(response.data);import os
from datetime import datetime
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.messages.conversations.mark_read(
peer_key="x",
up_to_message_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
up_to_occurred_at=datetime.fromisoformat("2019-12-27T18:11:19.117"),
)
print(response.data)curl --request POST \
--url https://api.mobilerun.ai/v1/numbers/messages/conversations/read \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"peerKey": "<string>",
"upToMessageId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"upToOccurredAt": "2023-11-07T05:31:56Z"
}
'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mobilerun.ai/v1/numbers/messages/conversations/read",
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([
'peerKey' => '<string>',
'upToMessageId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'upToOccurredAt' => '2023-11-07T05:31:56Z'
]),
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;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.mobilerun.ai/v1/numbers/messages/conversations/read"
payload := strings.NewReader("{\n \"peerKey\": \"<string>\",\n \"upToMessageId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"upToOccurredAt\": \"2023-11-07T05:31:56Z\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.mobilerun.ai/v1/numbers/messages/conversations/read")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"peerKey\": \"<string>\",\n \"upToMessageId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"upToOccurredAt\": \"2023-11-07T05:31:56Z\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mobilerun.ai/v1/numbers/messages/conversations/read")
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 \"peerKey\": \"<string>\",\n \"upToMessageId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"upToOccurredAt\": \"2023-11-07T05:31:56Z\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"updated": 1
}
}{
"message": "<string>",
"reason": "not_installed",
"success": false
}Authorizations
Bearer token via Authorization header
Body
application/json
Response
Read state updated
Show child attributes
Show child attributes
Was this page helpful?
⌘I