SMSFactor.SendSMS (SMSFactor v0.5.0)

View Source

Wrappers around Send SMS section of SMSFactor API.

Summary

Types

Params for sending SMS campaign.

Params for sending SMS.

Types

send_campaign_params()

@type send_campaign_params() :: %{sms: %{required(atom()) => any()}}

Params for sending SMS campaign.

  • text (required) : Your message
  • value (required) : The recipients' numbers
  • pushtype : The push type (alert or marketing)
  • delay : Sending date Y-m-d H:i:s
  • sender : Allows you to customize the sender
  • gsmsmsid : An id of your choice to link it to its delivery report

Example

{
  "sms": {
    "message": {
      "text": "Message via API",
      "pushtype": "alert",
      "sender": "Illidan",
      "delay": "2021-06-06 10:28:32"
    },
    "recipients": {
      "gsm": [
        {
          "gsmsmsid": "100",
          "value": "33612345678"
        },
        {
          "gsmsmsid": "101",
          "value": "33612345677"
        }
      ]
    }
  }
}

send_sms_params()

@type send_sms_params() :: %{required(atom()) => any()}

Params for sending SMS.

  • token (required if not in headers) : Your token
  • text (required) : Your message
  • to (required) : Your destination
  • pushtype : The push type (alert or marketing)
  • delay : Sending date Y-m-d H:i:s
  • sender : Allows you to customize the sender
  • gsmsmsid : An id of your choice to link it to its delivery report

Example

{
  "text": "Message via API",
  "to": ""33612345678"
  "pushtype": "alert",
  "sender": "Illidan",
  "delay": "2021-06-06 10:28:32",
  "gsmsmsid": "100"
}

Functions

campaign(client, params)

campaign_with_list(client, params)

@spec campaign_with_list(Tesla.Client.t(), send_campaign_params()) ::
  Tesla.Env.result()

cancel_campaign(client, campaign_id)

@spec cancel_campaign(Tesla.Client.t(), String.t()) :: Tesla.Env.result()

simulate_campaign(client, params)

@spec simulate_campaign(Tesla.Client.t(), send_campaign_params()) ::
  Tesla.Env.result()

simulate_single_message(client, params)

@spec simulate_single_message(Tesla.Client.t(), send_sms_params()) ::
  Tesla.Env.result()

single_message(client, params)

@spec single_message(Tesla.Client.t(), send_sms_params()) :: Tesla.Env.result()