Custom Provider

You can use a Custom Provider with our Push channel to send incoming messages to an arbitrary webhook. Normally these messages get send to the Courier Push Provider, but you might have your own system already setup to receive and display messages to your users.

To install the Custom Provider, navigate here: https://app.courier.com/integrations/custom. You should be able to input your webhook http address and choose between a few different authentication models.

After installing the Custom Provider, you should be able to add it to any Push Channel. After adding a "Push Channel", open up the Channel Settings Modal.

You will see "Custom" in the list of "Installed Providers".

You can now add a Title, and blocks to your designer. They will be sent over as both "plain text" and an array of "blocks" to the webhook configured.

Upon sending the message, your webhook will receive a payload that looks like this:

interface TextBlock {
  type: "text";
  text: string;
}

interface ActionBlock {
  type: "action";
  url: string;
  text: string;
}

interface PushMessage {
  type: "push";
  data: {
    messageId: string;
    content: {
      title: string;
      body: string;
      blocks: Array<ActionBlock | TextBlock>
    }
}
{
  "type": "push",
  "data": {
    "messageId": "1-6140e057-2749378a31c6026f3dab823f",
    "content": {
      "blocks": [
        {
          "text": "My Body",
          "type": "text"
        },
        {
          "text": "Click Here",
          "url": "https://rubmz24skk.execute-api.us-east-1.amazonaws.com/dev/r/c4cf42e6-8cb1-4276-8a90-034ae2f38e65.wefvkrd7sbm0h8j3dtrezbem5qwe",
          "type": "action"
        }
      ],
      "body": "My Body\nClick Here: https://rubmz24skk.execute-api.us-east-1.amazonaws.com/dev/r/c4cf42e6-8cb1-4276-8a90-034ae2f38e65.9kwnzgbapy4914hdedrm4fwdaxjc",
      "title": "My Title"
    }
  }
}

Did this page help you?