Skip to content

Get Status

The status of the slack message can be requested by specifying the request_id that was returned from Send Message endpoint.

GET
/report/v1/message-log/{request_id}

Authentication

AUTHORIZATIONS: Bearer Token

Request parameters

Parameter Value / Pattern Example(s)
*request_id request_id that was returned from Send Message endpoint ceba9fac-838c-44c7-b67d-03a4a6352058

Request

curl --location -g --request GET 'https://api.d7networks.com/report/v1/message-log/{{request_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_slack_message
const response = await client.slack.getStatus({request_id: "002ad5b1-c142-4273-8d82-56da6ea5f5c3"});

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_slack_message
client.slack.get_status(request_id="0012c7f5-2ba5-49db-8901-4ee9be6dc8d1")

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

use direct7\Direct7\Client;

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

$response = $direct7->slack->getStatus(request_id:'deb7c268-cde9-4782-a4a7-9bc03a82bd1d');
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)
slack := direct7.NewSlack(client)
requestID := "001ff613-de30-4f82-81f6-1fe944b8f61b"
statusResponse, err := slack.GetStatus(requestID)
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/report/v1/message-log/{{request_id}}")
.method("GET", 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('GET', Uri.parse('https://api.d7networks.com/report/v1/message-log/{{request_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/report/v1/message-log/{{request_id}}' -Method 'GET' -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_slack_message
client.slack.get_status(request_id="0012c7f5-2ba5-49db-8901-4ee9be6dc8d1")

Response:

200 - Success
{
    "request_id": "002f0e62-dbf0-42e2-aae1-e2acf74143f5",
    "channel": "slack",
    "messages": [
        {
            "msg_id": "a6c92cac-0a94-11ee-a7ad-0242c0a82022",
            "channel": "slack",
            "work_space_name": "Demo Messaging",
            "slack_channel_name": "random",
            "status": "delivered"
        }
    ],
    "request_stage": "processed"
}
404 - Not Found
{
    "detail": {
        "code": "MESSAGE_LOG_NOT_EXISTS",
        "message": "Given message request id not exists in the system. Please Try Again!"
    }
}

Response Parameters

Parameter Value / Pattern Example(s)
channel Messaging channels such as slack slack
msg_id The message id for each message in the request a6c92cac-0a94-11ee-a7ad-0242c0a82022
channel Messaging channels such as slack slack
status This is the status of the message, and we have the following statuses: [delivered - Delivered to destination and confirmed], [undelivered - Failed delivery] delivered
work_space_name Name of the Workspace to which the message is sent Demo Works
slack_channel_name Name of the Slack channel to which the message is sent general
request_stage Request is processed or not processed
schedule_time If the message is scheduled, this will return the time null