Skip to content
Nofy by Encipher Docs

Get started

Quickstart

Send your first notification in about five minutes, from a token to a tracked delivery.

You need an OAuth application (client id and secret) from your Nofy operator. Everything else below is self-service.

Base URL

Every request goes to https://nofy.encipher.co.tz. The original host, https://ens.encipher.co.tz, serves the same API for existing integrations.

  1. Get a token

    Exchange your client credentials for a Bearer token:

    Terminal
    curl -X POST https://nofy.encipher.co.tz/v1/oauth2/token/ \
      -d grant_type=client_credentials \
      -d client_id=YOUR_CLIENT_ID \
      -d client_secret=YOUR_CLIENT_SECRET
    
    JSON
    {
      "access_token": "abc123",
      "expires_in": 36000,
      "token_type": "Bearer",
      "scope": "read write"
    }
    

    Pass it as Authorization: Bearer abc123 on every call. Tokens carry no user: the API authorizes the client, and every send is attributed to it.

  2. Provision a tenant

    A tenant is one of your customers. Sends to unknown tenants are rejected, so register each one first. Provisioning again is safe and returns the existing tenant:

    Terminal
    curl -X POST https://nofy.encipher.co.tz/v2/tenants \
      -H "Authorization: Bearer abc123" \
      -H "Content-Type: application/json" \
      -d '{"external_id": "company-uuid-1", "name": "Acme Fuel"}'
    
  3. Send a message

    One handoff with an Idempotency-Key header, so a retried request never sends twice. Python has an SDK; every other language calls the same HTTP API:

    from ens_sdk import ENS
    
    # ENS_SERVER_URL, ENS_CLIENT_ID, ENS_CLIENT_SECRET, ENS_TENANT
    ens = ENS()
    ens.send_sms("+255700000000", "Shift closed at 18:00.")
    

    A 202 means accepted and queued, not delivered. The response lists one delivery per recipient, each starting as pending:

    JSON
    {
      "reference": "shift-8841",
      "message_id": "vA51xTo874Y8",
      "deliveries": [
        {
          "id": "dL91...",
          "channel": "sms",
          "recipient": "255700000000",
          "status": "pending"
        }
      ]
    }
    
  4. Track the delivery

    Pull your deliveries, filtered by your own reference:

    Terminal
    curl "https://nofy.encipher.co.tz/v2/deliveries?reference=shift-8841" \
      -H "Authorization: Bearer abc123"
    

    Or pass a callback_url on the send and receive a signed post as each delivery resolves.

Next steps

Esc
↑↓ to move↵ to open