Examples

POST /api/v2/activities
{
  "data": {
    "type": "activities",
    "attributes": {
      "key": "comment.view_thread",
      "created-at": null,
      "anonymize": false,
      "origin": "smartkarma",
      "parameters": {},
      "direction": null
    },
    "relationships": {
      "trackable": {
        "data": {
          "type": "comments",
          "id": "1"
        }
      }
    }
  }
}
201
{
  "data": {
    "id": "106",
    "type": "activities",
    "links": {
      "self": "http://test.host/api/v2/activities/106"
    },
    "attributes": {
      "key": "comment.view_thread",
      "created-at": "2017-08-29T10:44:38.160+08:00",
      "anonymize": false,
      "origin": "smartkarma",
      "parameters": {},
      "direction": "outgoing"
    },
    "relationships": {
      "trackable": {
        "links": {
          "self": "http://test.host/api/v2/activities/106/relationships/trackable",
          "related": "http://test.host/api/v2/activities/106/trackable"
        }
      },
      "owner": {
        "links": {
          "self": "http://test.host/api/v2/activities/106/relationships/owner",
          "related": "http://test.host/api/v2/activities/106/owner"
        }
      },
      "recipient": {
        "links": {
          "self": "http://test.host/api/v2/activities/106/relationships/recipient",
          "related": "http://test.host/api/v2/activities/106/recipient"
        }
      }
    }
  }
}

Params

Param name Description
data
required

Activity information

Validations:

  • Must be a Hash

data[key]
required

Activity key

Validations:

  • Must be a String

data[parameters]
optional

Additional information needed to be stored

Validations:

  • Must be a Hash

data[relationships]
required

Validations:

  • Must be a Hash

data[relationships][trackable]
required

Validations:

  • Must be a Hash

data[relationships][trackable][data]
required

Validations:

  • Must be a Hash

data[relationships][trackable][data][type]
required

Trackable type

Validations:

  • Must be a String

data[relationships][trackable][data][id]
required

Trackable ID

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hyphen(-) with no leading or trailing space.