Skip to content

feat: implement Arkesel SMS provider (Ghana / West Africa) #57

Open

Description

@teesofttech

Summary

Implement the Arkesel SMS provider inside src/SmsBridge/Providers/Arkesel/.

Arkesel is a Ghana/West Africa communication provider with OpenAPI documentation for SMS V1, SMS V2, Voice, OTP, USSD, and related APIs. This adds a strong West African provider option beyond Hubtel.

Official docs:

Files to create

  • src/SmsBridge/Providers/Arkesel/ArkeselSmsProvider.cs
  • src/SmsBridge/Providers/Arkesel/ArkeselSmsRequestMapper.cs
  • src/SmsBridge/Providers/Arkesel/ArkeselSmsResponseMapper.cs
  • src/SmsBridge/Options/ArkeselOptions.cs
  • Register UseArkesel() in src/SmsBridge/DependencyInjection/SmsBridgeProviderBuilder.cs
  • Add HttpClientNames.Arkesel in src/SmsBridge/Internal/Http/HttpClientNames.cs
  • Add SmsProviderType.Arkesel to the enum

Arkesel API Details

  • Base URL: https://sms.arkesel.com
  • SMS V1 send endpoint: GET /sms/api?action=send-sms
  • SMS V1 auth: api_key query parameter
  • SMS V1 request fields include api_key, to, from, sms, and optional use_case for Nigerian contacts
  • SMS V2 uses API key in a header; prefer SMS V2 if its send endpoint is stable and straightforward in the OpenAPI spec
  • Response/status docs include:
    • V1 success: OK
    • V1 errors: 100, 101, 102, 103, 104, 105, 106, 109, 111
    • V2 success: 200
    • V2 errors: 401, 402, 403, 422, 500

Options

public sealed class ArkeselOptions
{
    public required string ApiKey { get; init; }
    public required string Sender { get; init; }
    public string? UseCase { get; init; }
    public bool UseSmsV2 { get; init; } = true;
}

Implementation Notes

  • Prefer SMS V2 if the send endpoint is confirmed from the spec; otherwise implement V1 first because it is explicitly documented.
  • Add use_case support for Nigerian contacts when configured.
  • Map accepted response details to SmsSendResult.ProviderMessageId where available; otherwise map success without a provider id.
  • Map documented status codes to SMSBridge failure semantics.

Tests to add

  • tests/SmsBridge.ProviderTests/ArkeselResponseMapperTests.cs
  • tests/SmsBridge.ProviderTests/ArkeselProviderTests.cs

Acceptance Criteria

  • Provider sends SMS through Arkesel using IHttpClientFactory
  • Provider supports configured sender and optional use_case
  • Provider authenticates with configured API key
  • Response mapper handles documented V1/V2 success and error codes
  • Provider maps Arkesel API failures to failed SmsSendResult
  • Transient HTTP failures set IsTransientFailure = true
  • UseArkesel() registers the provider in DI
  • All tests pass - dotnet test
  • dotnet build has 0 warnings

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions