go

When you send an SMS, you can get notified of its delivery. This guide will show you how to send an SMS so that you get a delivery notification using the Infobip Go SDK, and a web-based hook tool.

Prerequisites

  • Basic Go and API knowledge
  • Go 13 (or newer) installation
  • A running Go project

Steps overview

  1. Set up a HookRelay account.
  2. Set up a hook for delivery reports.
  3. Send a message.
  4. Check for delivery notifications.

Setup a HookRelay account

Normally, you would have set up a server that listens to the SMS delivery notifications, but for this guide, we’ll show you how to see delivery notifications in a web-based hook service.

For this, you need a HookRelay account. You can log in with a GitHub or GitLab account. Just click on the “Start for free” button and use your Git login as normal.

Setup a hook for delivery reports

Once you log in, you’ll see a dashboard like this:

Hooks Dashboard

Click on the “New hook” button, and set a name like “Infobip SMS Delivery Reports”. The hook should be Inbound, and you don’t need to set anything else in the configuration. Just click on “Create hook”

Create Hook

After that, you’ll be able to click on your new hook, and see something like this:

Hook

Copy the URL it shows into your clipboard.

Send a message

Now, you need to send a message in the same way as in the Send SMS Guide, only this time set the NotifyURL field in the SMSMsg instance with the URL you copied from the hook. Like this:

msg := models.SMSMsg{
  Destinations: []models.SMSDestination{
    {To: "523322600428"},
  },
  From:      "Cool Gopher",
  Text:      "Hello from Infobip Go SDK!",
  NotifyURL: "https://api.hookrelay.dev/hooks/rewk0zy698q0h6w9x4qgjm73/7f634d2cb9881bc547e25adc",
}

And proceed to send your message.

Check for delivery notifications

Once you’ve sent your message, barring any traffic delays, you’ll be able to see that your hook has a new notification in the “Deliveries” section of the hook. Click on the “refresh” blue text and you’ll see some activity in your hook.

Hook Deliveries

After that, you can click on the event ID and you’ll see the details of the message that was delivered:

Delivery Report

You should see all kinds of information about the message, and a status containing the DELIVERED_TO_HANDSET value.
You can check the response and status reference for more information.

And that’s all for this guide.

Thanks for reading!