Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT]: Send sms endpoint #168

Open
6 tasks
EmmanuelOmoiya opened this issue Jul 28, 2024 · 0 comments
Open
6 tasks

[FEAT]: Send sms endpoint #168

EmmanuelOmoiya opened this issue Jul 28, 2024 · 0 comments
Assignees
Labels
email label related to mailing features

Comments

@EmmanuelOmoiya
Copy link
Contributor

Description

Endpoint to send sms to a customer or user.

Acceptance Criteria

  • The endpoint should be accesible at /api/v1/sms/send.

  • The endpoint should accept HTTP POST requests.

  • The endpoint should be secured to ensure that only a user with an admin role.

  • Proper authentication mechanisms (e.g. JWT, OAuth2) should be implemented.

  • Requests to the endpoint must include a valid authentication token in the Authorization header. Authorization: Bearer <token>

  • Request body

    {
        "message": "Hey there, how are you doing",
        "recipient": "+2347043738436",
    }
  • Response (Success)

    {
       "status_code": "200",
       "message": "Sms sending request accepted and is being proccessed",
       "error": "",
    }
  • Response (Error)

    {
        "status_code": 401,
        "message": "Unauthorized",
        "error": "Bad Request"
    }

    Internal Server Error

    {
        "status_code": 500,
        "message": "Internal server error",
        "error": "Bad Request"
    }

Purpose

To send sms to a customer / user.

Requirements

  • User must be authenticated thereby having a Authoirization: Bearer <token> header in the request body
  • User must have the role of an admin
  • User account must be active

Expected Outcome

  • A response with status_code of 200 and message of "Sms sending request accepted and is being proccessed"

Testing

  1. Unit Tests
    The system should have unit tests covering:
  • Ensure the request body has the right properties and the value are of the right type
  • Test that the appropriate response and status code is returned
@Cyberguru1 Cyberguru1 added the email label related to mailing features label Jul 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
email label related to mailing features
Projects
None yet
Development

No branches or pull requests

2 participants