Attachments

Note: This page has not yet been converted to the new developer portal format. Please use Swagger to test this API.

Attachments

To send a standard
notification with an attachement first retrieve the fileID field from the attachmentFiles array.

The fileId is generated as a response to POST /attachments

The request body should be a base64 encoded binary object that is the file you wish
to attach. For reference or testing, here's a cURL command you can use. The filename parameter assumes
it's in the current working directory.

curl --insecure --header "Authorization: Basic {credentials}" -F "file=@{filename}"   
https://api.everbridge.net/rest/audio/{organizationId}

That CURL command will return a response similar to this:

{
  "message": "OK",
  "fileId": "540dfd58e4b04f1e4f25a50d",
  "fileName": "Attachment.txt",
  "size": 19486,
  "image": false
}

The fileID field is what you want to use in the notification JSON while launching a notification below:

{
  "broadcastContacts": {
    "contactIds": [
      5743857366033992
    ],
    "externalIds": [],
    "groupIds": [],
    "filterIds": []
  },
  "type": "Standard",
  "priority": "NonPriority",
  "launchtype": "SendNow",
  "message": {
    "contentType": "Text",
    "title": "Test with one attachment",
    "textMessage": "This notification has one attachment.",
    "attachmentFiles": [
      {
        "fileId": "540dfe8ae4b0f6f2051763e0"
      }
    ]
  }
}

GET /attachments/{organizationId}/{fileId}

Description

Return a specific attachment.

Return type

attachment instance

Parameters

NameData TypeRequired?Description
credentialsstringyBasic Authorization header.
organizationIdlongyThe ID of the organization containing the attachment.
fileRequestMultipartHttpServletRequestyMultipart file upload body.

POST /attachments/{organizationId}

Description

Upload an attachment and return the unique field assigned to that resource. THis
key can be used as the elements of a notification message.attachmentFiles object.

Return type

attachmentUploadResult instance

Parameters

NameData TypeRequired?Description
credentialsstringyBasic Authorization header.
organizationIdlongyThe ID of the organization containing the attachment.
fileRequestMultipartHttpServletRequestyMultipart file upload body