# variables
@base_url = {{$dotenv BASE_URL}}
@api_key = {{$dotenv API_KEY}}
@message_id = {{$dotenv MESSAGE_ID}}

### 1. Get all messages
GET {{base_url}}/messages
api_key: {{api_key}}

### 2. Get a single message by its ID
GET {{base_url}}/messages/{{message_id}}
api_key: {{api_key}}

### 3. Send an SMS notification
POST {{base_url}}/messages
content-type: application/json
api_key: {{api_key}}

{
  "message": {
    "type": "sms",
    "content": "Your OTP code is 1234",
    "phone": {
      "country_code": "254",
      "number": "718444555"
    }
  }
}

### 4.1 Send an Email notification (default content type = text)
POST {{base_url}}/messages
content-type: application/json
api_key: {{api_key}}

{
  "message": {
    "type": "email",
    "email": "[email protected]",
    "subject": "One Time Password",
    "content": "Your OTP code is 1234"
  }
}

### 4.2 Send an Email notification (explicit content type = text)
POST {{base_url}}/messages
content-type: application/json
api_key: {{api_key}}

{
  "message": {
    "type": "email",
    "content_type": "text",
    "email": "[email protected]",
    "subject": "One Time Password",
    "content": "Your OTP code is 1234"
  }
}

### 4.3 Send an Email notification (explicit content type = html)
# If sending an email with html content, failure to explicitly declare a content_type of email will have your email being sent as a normal text email
POST {{base_url}}/messages
content-type: application/json
api_key: {{api_key}}

{
  "message": {
    "type": "email",
    "content_type": "html",
    "email": "[email protected]",
    "subject": "One Time Password",
    "content": "<html><body><div>Your OTP code is 1234</div></body></html>"
  }
}