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]: Endpoint for Sending SMS using Twilio API #215

Open
2 tasks
shedrack-alita opened this issue Jul 24, 2024 · 0 comments
Open
2 tasks

[FEAT]: Endpoint for Sending SMS using Twilio API #215

shedrack-alita opened this issue Jul 24, 2024 · 0 comments

Comments

@shedrack-alita
Copy link

##Description
Implement an API endpoint for sending SMS using Twilio API. This endpoint should allow users to send SMS messages to a specified call number.

##Acceptance Criteria

  • The endpoint should be specified at post/api/v1/sms/send
  • The endpoint should accept HTTP POST request.
  • The endpoint should send an SMS message using Twilio API messaging content through the call number provided
  • The endpoint should return a 200 status code with a success response message in JSON format

##Request Sample:

post/api/v1/sms/send
content-type: application/json
{
   "phon_number": "+2349018657226",
   "message": "Hello there! this is your first message"
}

##Response Sample:
Upon successful request, the API will return a 200 status code showing that the SMS message have been delivered.

"status": "Success",
"status_code": 200,
"message": "SMS successfully sent"

##Validation:

  • If the phone number is invalid or message content is missing, then the API will return a 400 bad request status code with the error response below:
"status": "Unsuccessful",
"status_code": 400,
"message": "Message content and a valid call number must be provided"
  • If an error occurs as a result of an invalid Twilio credentials, or bad network, the API wil return a 500 internal server error status code with the appropriate error message as shown:
"status": "Unsuccessful",
"status_code": 500,
"message": "SMS sending failed, please try again later"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant