Quick Start

Webhooks allow you to push Somewear data to your server via a HTTP POST request.

Sample Repo

https://github.com/somewear-labs/hello-space-server

Configure

You must have a Somewear Organization to create webhooks. If you're interested in setting up a Somewear Organization with our team/enterprise plans, please inquire at https://somewearlabs.com/ or contact sales@somewearlabs.com.

  1. Sign into the Somewear web app at https://somewear.app.

  2. Navigate to your Organization Settings page by clicking Account > Settings.

  3. Click Add Server Connection > Webhook.

  4. Fill out the name & URL for your webhook. Somewear will send a HTTP POST request to this address. You can include basic credentials in the Authentication Credentials section or any other required headers like API keys in the Custom Headers section.

  5. Click submit and the webhook will be tested with a health check request.

  6. Upon save, click the settings icon to configure which Workspaces will push data to your webhook.

JSON

Location
{
  "requestId": "66ef6f9b-8870-4e18-99e1-f14ee7eae91d",
  "payloads": [
    {
      "identity": {
        "id": "0",
        "name": "Example User",
        "type": "User",
        "email": "example@example.com"
      },
      "account": {
        "id": "0",
        "workspaceId": "0",
      },
      "workspace": {
        "id": "0",
        "name": "Example Workspace"
      },
      "events": [
        {
          "type": "Location",
          "latitude": "37.781001",
          "longitude": "-122.393456",
          "altitude": "1000.0",
          "timestamp": "2023-04-12T19:15:14Z"
        }
      ]
    }
  ]
}
Data
{
  "requestId": "fe06b693-af2e-49da-963b-97fddaaa97eb",
  "payloads": [
    {
      "identity": {
        "id": "0",
        "name": "Example User",
        "type": "User",
        "email": "example@example.com"
      },
      "account": {
        "id": "0",
        "workspaceId": "0",
      },
      "workspace": {
        "id": "0",
        "name": "Example Workspace"
      },
      "events": [
        {
          "type": "Data",
          "payload": "VGVzdAo=",
          "timestamp": "2023-04-12T18:56:32Z"
        }
      ]
    }
  ]
}
Message
{
  "requestId": "66ef6f9b-8870-4e18-99e1-f14ee7eae91d",
  "payloads": [
    {
      "identity": {
        "id": "0",
        "name": "Example User",
        "type": "User",
        "email": "example@example.com"
      },
      "account": {
        "id": "0",
        "workspaceId": "0",
      },
      "workspace": {
        "id": "0",
        "name": "Example Workspace"
      },
      "events": [
        {
          "type": "Message",
          "timestamp": "2023-04-12T19:15:14Z"
          "content": "Example content"
        }
      ]
    }
  ]
}
Sos Event
{
  "requestId": "66ef6f9b-8870-4e18-99e1-f14ee7eae91d",
  "payloads": [
    {
      "identity": {
        "id": "0",
        "name": "Example User",
        "type": "User",
        "email": "example@example.com"
      },
      "account": {
        "id": "0",
        "workspaceId": "0",
      },
      "workspace": {
        "id": "0",
        "name": "Example Workspace"
      },
      "events": [
        {
          "type": "SosEvent",
          "eventType": "Alarm",
          "sessionId": "0",
          "latitude": "37.781001",
          "longitude": "-122.393456",
          "timestamp": "2023-04-12T19:15:14Z"
        }
      ]
    }
  ]
}
eventType:
  Alarm - When the user first triggers the SOS
  AlarmCancel - When the user resolves their SOS

Last updated