Skip to content

Get SMS Status using HMAC authentication #4

@linktoahref

Description

@linktoahref

Hi,

Using:

  • PHP
  • Guzzle

I am trying to retrieve the status of the sent SMS using the transaction ID.

HMAC Authentication:
$client = new Client();

$response = $client->request(
    'GET',
    "https://rest.spirius.com/v1/sms/mt/status" . "/{$id}",
    [
        'headers' => [
            "X-SMS-Timestamp" => <timestamp>
            "Authorization" => "SpiriusSmsV1 <username>:<generated hash>"
        ]
    ]
);

Returns: 401 Unauthorised response { "detail": "Not authenticated" }


Basic Authentication
$client = new Client();

$response = $client->request(
    'GET',
    "https://rest.spirius.com/v1/sms/mt/status" . "/{$id}",
    [
        'headers' => [
            'Authorization' => 'Basic '. base64_encode($this->username . ":" . $this->password)
        ],
    ]
);

Returns 200 Response

[
  "result" => 1
  "statusCode" => 1
  "detail" => "The message has been successfully delivered"
  "transactionId" => "<transaction id>"
  "timestamp" => "<timestamp>"
  "timezone" => "<timezone>"
]

Also tried

$client = new Client();

$response = $client->request(
    'GET',
    "https://rest.spirius.com/v1/sms/mt/status" . "/{$id}",
    [
        'headers' => [
            "Authorization" => "SpiriusSmsV1 <username>:<generated hash>"
        ]
    ]
);

Returns: 401 Unauthorised response { "detail": "Not authenticated" }


Please note the generated hash is valid as I am able to send SMS using the HMAC Authentication method.

Is HMAC authentication supported to get the status of the SMS? Or is it only available via Basic Authentication?

Thank you.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions