Parent-Child API

Unit21 has built functionality into its API to allow Parent Organizations send Child Org data on their behalf as long as the Child is not a Unit21 customer.

The main change to note is that the request URL will now contain the name of the Child Organization. The API Key, however, will be one generated from the Parent Org.

Example: Creating an entity

Let's assume that a Parent is attempting to send data for a Child called finpay (Child Org name).

📘

Note that the Child Org must exist on the platform!

curl --request POST \
     --url https://sandbox1-api.unit21.com/v1/sponsor/finpay/entities/create \
     --header 'Accept: application/json' \
     --header 'Content-Type: application/json' \
     --header 'u21-key: {YOUR_KEY}' \
     --data '
        {
      "general_data": {
          "entity_id": "userB-4023sd92j",
          "entity_type": "user",
          "entity_subtype": "payments",
          "status": "active",
          "registered_at": 1572673226,
          "parents": [
              {
                  "entity_id": "userC-39en293",
                  "entity_type": "user"
              }
          ],
          "tags": [
              "account_type:market2",
              "sector:europe"
          ]
      },
      "user_data": {
          "first_name": "John",
          "middle_name": "Joseph",
          "last_name": "Smith",
          "day_of_birth": 14,
          "month_of_birth": 1,
          "year_of_birth": 1983,
          "gender": "male",
          "ssn": "733-99-5921"
      },
      "document_data": {
          "document_id": "G3352403F",
          "document_type": "drivers_license",
          "state": "CA",
          "country": "US"
      },
      "communication_data": {
          "email_addresses": [
              "[email protected]"
          ],
          "phone_numbers": [
              "+14159627132"
          ]
      },
      "location_data": {
          "building_number": "712",
          "unit_number": "A",
          "street_name": "California Ave",
          "city": "Redmond",
          "state": "WA",
          "postal_code": "98008",
          "country": "US"
      },
      "digital_data": {
          "ip_addresses": [
              {
                  "ip_address": "1.1.1.1",
                  "first_seen": 1572643226,
                  "last_seen": 1572673226
              },
              {
                  "ip_address": "2.2.2.2",
                  "first_seen": 1572643225,
                  "last_seen": 1572673225
              }
          ],
          "client_fingerprints": [
              {
                  "client_fingerprint": "fingerprintA-{{randId}}",
                  "first_seen": 1572643226,
                  "last_seen": 1572673229
              }
          ]
      },
      "custom_data": {
          "internal_notes": "Reviewed by aaa on 31 June 2019"
      }
        }

Supported Endpoints for Parents

Note that child_org refers to the name of the child organization that the parent is sending data for.

Entities

Endpoint

URL

Create Entity [POST]:

v1/sponsor/{child_org}/entities/create

Update Entity [PUT]:

v1/sponsor/{child_org}/entities/{unit21_entity_id}/update

Get Entity [GET]:

v1/sponsor/{child_org}/entities/{unit21_entity_id}

List Entity [POST]:

v1/sponsor/{child_org}/entities/list

Link Media to Entity [PUT]:

v1/sponsor/{child_org}/entities/{unit21_entity_id}/link-media

Delete all Media from Entity [PUT]:

v1/sponsor/{child_org}/entities/{unit21_entity_id}/delete-all-media

Events

Endpoint

URL

Create Event [POST]:

v1/sponsor/{child_org}/events/create

Update Event [PUT]:

v1/sponsor/{child_org}/events/{unit21_event_id}/update

Get Event[GET]:

v1/sponsor/{child_org}/events/{unit21_event_id}

List Event [POST]:

v1/sponsor/{child_org}/events/list

Instruments

Endpoint

URL

Create Instrument [POST]:

v1/sponsor/{child_org}/instruments/create

Create Instrument [POST]:

v1/sponsor/{child_org}/instruments/create

Create Instrument [POST]:

v1/sponsor/{child_org}/instruments/create

List Instrument [POST]:

v1/sponsor/{child_org}/instruments/list

Alerts

Endpoint

URL

List Instrument [POST]:

v1/sponsor/{child_org}/instruments/list

List Instrument [POST]:

v1/sponsor/{child_org}/instruments/list

Get Alert [GET]:

v1/sponsor/{child_org}/alerts/{unit21_alert_id}

Get Alert [GET]:

v1/sponsor/{child_org}/alerts/{unit21_alert_id}

Link Media to Alert [PUT]:

v1/sponsor/{child_org}/alerts/{unit21_alert_id}/link-media

Cases

Endpoint

URL

Create Case [POST]:

v1/sponsor/{child_org}/cases/create

Create Case [POST]:

v1/sponsor/{child_org}/cases/create

Create Case [POST]:

v1/sponsor/{child_org}/cases/create

Create Case [POST]:

v1/sponsor/{child_org}/cases/create

Create Case [POST]:

v1/sponsor/{child_org}/cases/create

Add objects to Case [PUT]:

v1/sponsor/{child_org}/cases/{unit21_case_id}/add-objects