/textlocal

Send SMS from Salesforce using Textlocal API and External Services 🚀📱🌩️

📱 Textlocal API and External Services

Send SMS from Salesforce using Textlocal API and External Services with absolutely zero Apex!

image

📝 Tasks: Textlocal

  1. Sign-up for a free Textlocal account. Visit - https://www.textlocal.in

  2. Generate an API Key.

  3. Visit the Developer Docs - https://api.textlocal.in/docs/sendsms to learn how you can send an SMS using a simple GET verb.

📝 Tasks: Salesforce

  1. Create a Named Credential with URL - https://api.textlocal.in

  2. Create a Custom Setting (Hierarchy) to store the API Key and the name of the Sender: TXTLCL (This is a constant)

image

  1. Register an External Service with below Swagger schema -
{
  "swagger": "2.0",
  "info": {
    "title": "TextLocal Send SMS API",
    "description": "Send SMS from Salesforce using TextLocal",
    "version": "1.0.0"
  },
  "host": "api.textlocal.in",
  "schemes": [ "https" ],
  "paths": {
    "/send": {
      "get": {
        "produces": [ "application/json" ],
        "parameters": [
          {
            "in": "query",
            "name": "apikey",
            "type": "string",
            "required": true
          },
          {
            "in": "query",
            "name": "numbers",
            "type": "string",
            "required": true
          },
          {
            "in": "query",
            "name": "message",
            "type": "string",
            "required": true
          },
          {
            "in": "query",
            "name": "sender",
            "type": "string",
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Operation",
            "schema": {
              "$ref": "#/definitions/Response"
            }
          }
        }
      }
    }
  },
  "definitions": {
    "Response": {
      "type": "object",
      "properties": {
        "balance": {
          "type": "integer",
          "format": "int64"
        },
        "status": {
          "type": "string"
        }
      }
    }
  }
}

Note: To validate a Swagger Schema (written by yourself), visit - http://editor.swagger.io/

  1. Create a Flow to consume the External Service as an Apex Action: image image image

  2. Activate the Flow.

📚 Resources

What if I want to learn more about External Services. Visit - https://trailhead.salesforce.com/en/content/learn/modules/external-services