Skip to content

Read Receipt

When you receive an incoming message from Webhooks, you can use the below endpoint to mark the message as read. Messages marked as read display two blue check marks alongside their timestamp:

Image Alt Text

Endpoint

POST
/whatsapp/v2/read-receipt/{message_id}


POSTMAN

Authentication

AUTHORIZATION: Bearer Token

Request parameters

Parameter Value / Pattern Example(s)
*message_id Message Id that is displayed in api reports for user initiated messages 492a17b0-9cd7-11ef-b4bf-0242ac1b0024

Response:

200 - Success
    Message successfully marked as read
404 - Not Found
{
    "detail": {
        "code": "WHATSAPP_MESSAGE_NOT_EXISTS",
        "message": "Given whatsapp message id not exists in the system. Please use correct message id!"
    }
}

Programming Examples

curl --location -g --request POST 'https://api.d7networks.com/whatsapp/read-receipt/{{message_id}}' \
--header 'Authorization: Bearer {{api_access_token}}'
npm i direct7
1
2
3
4
5
6
7
8
const Client = require('direct7')

const client = new Client(apiToken="Your API token")

# request_id is the id returned in the response of send_message
const response = await client.whatsapp.readReceipt({message_id: "987efe2a-c68f-4cfb-8301-662b574d21c0"});

console.log(response);
pip install direct7
1
2
3
4
5
6
from direct7 import Client

client = Client(api_token="Your API token")

# request_id is the id returned in the response of send_message
client.whatsapp.read_receipt(message_id="0012c7f5-2ba5-49db-8901-4ee9be6dc8d1")

composer require direct7/direct7-php
require_once 'vendor/autoload.php';
1
2
3
4
5
6
7
8
9
require_once __DIR__ . '/vendor/autoload.php';

use direct7\Direct7\Client;

$client = new Client(api_token="Your API token")

$response = $direct7->whatsapp->readReceipt('469affd7-0983-4bbc-9d07-ee43e1d1cfef');

var_dump($response);
go get -u github.com/d7networks/direct7-go-sdk
1
2
3
4
5
6
7
8
import (
    "github.com/d7networks/direct7-go-sdk/direct7"
    )   
apiToken := "Your Api Token"
client := direct7.NewClient(apiToken)
whatsapp := direct7.NewWhatsApp(client)
messageID := "001ff613-de30-4f82-81f6-1fe944b8f61b"
statusResponse, err := whatsapp.ReadReceipt(messageID)
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
.url("https://api.d7networks.com/whatsapp/read-receipt/{{message_id}}")
.method("POST", body)
.addHeader("Authorization", "Bearer {{api_access_token}}")
.build();
Response response = client.newCall(request).execute();
var headers = {
'Authorization': 'Bearer {{api_access_token}}'
};
var request = http.Request('POST', Uri.parse('https://api.d7networks.com/whatsapp/read-receipt/{{message_id}}'));

request.headers.addAll(headers);

http.StreamedResponse response = await request.send();

if (response.statusCode == 200) {
print(await response.stream.bytesToString());
}
else {
print(response.reasonPhrase);
}
1
2
3
4
5
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Authorization", "Bearer {{api_access_token}}")

$response = Invoke-RestMethod 'https://api.d7networks.com/whatsapp/read-receipt/{{message_id}}' -Method 'POST' -Headers $headers
$response | ConvertTo-Json
gem install direct7
1
2
3
4
5
6
require 'direct7'

client = Direct7::Client.new('Your API token')

# request_id is the id returned in the response of send_message
client.whatsapp.read_receipt(message_id="0012c7f5-2ba5-49db-8901-4ee9be6dc8d1")