Permissions

The Permission object

A Permission object has the following properties:

  • id : string - The unique identifier of a permission

Create a permission

Creates a permission granting access to a data source to a specific person.

POST /api/v2/data-source/:data-source/permission/person/:person

Arguments:

  • data-source - The identifier of a data source
  • person - The identifier of a person
  • duration - integer : The number of seconds the permission will be active
  • startsAt - timestamp : An optional, deferred time for the permission to start; otherwise, the permission will start immediately

Response object:

  • A newly-created Permission object with the following properties:
  • id - string : The unique identifier of the permission
  • startsAt - timestamp : When the permission is set to start
  • expiresAt - timestamp : When the permission is set to expire
  • createdAt - timestamp : When the permission was created

Example request (starting immediately):

$ curl \
    -H "Accept: application/vnd.jackdb.v2+json" \
    -u "${JACKDB_API_KEY_ID}@api:${JACKDB_API_KEY_SECRET}" \
    -X POST \
    -d "duration=86400" \
    "${JACKDB_API_URL}/data-source/DUGC6IqGQ4DX00Lt0/permission/person/P0cKFCMIHoNaBFt7Y"

Example response:

{
  "id": "13382",
  "startsAt": "2015-03-12T22:17:29.609Z"
  "expiresAt": "2015-03-13T22:17:29.609Z",
  "createdAt": "2015-03-12T22:17:29.609Z"
}

Example request (deferred):

$ curl \
    -H "Accept: application/vnd.jackdb.v2+json" \
    -u "${JACKDB_API_KEY_ID}@api:${JACKDB_API_KEY_SECRET}" \
    -X POST \
    -d "duration=86400&startsAt=2015-03-23T23:00:00.000Z" \
    "${JACKDB_API_URL}/data-source/DUGC6IqGQ4DX00Lt0/permission/person/P0cKFCMIHoNaBFt7Y"

Example response:

{
  "id": "23385",
  "startsAt": "2015-03-23T23:00:00.000Z"
  "expiresAt": "2015-03-24T23:00:00.000Z",
  "createdAt": "2015-03-21T22:17:29.609Z"
}

Delete a permission

Permanently deletes an existing permission.

DELETE /api/v2/permission/:permission

Arguments:

  • permission - The identifier of the permission to be deleted

Response object:

This method returns an object with no properties.

Example request:

$ curl \
    -H "Accept: application/vnd.jackdb.v2+json" \
    -u "${JACKDB_API_KEY_ID}@api:${JACKDB_API_KEY_SECRET}" \
    -X DELETE \
    "${JACKDB_API_URL}/permission/19213"

Example response:

{}

Delete all permissions (specific)

Permanently deletes all permissions associated with a specific person and data source.

DELETE /api/v2/data-source/:data-source/permission/person/:person

Arguments:

  • data-source - The identifier of a data source
  • person - The identifier of a person

Response object:

  • An object with the following properties:
    • count - integer : the number of deleted permissions

Example request:

$ curl \
    -H "Accept: application/vnd.jackdb.v2+json" \
    -u "${JACKDB_API_KEY_ID}@api:${JACKDB_API_KEY_SECRET}" \
    -X DELETE \
    "${JACKDB_API_URL}/data-source/DUGC6IqGQ4DX00Lt0/permission/person/P0cKFCMIHoNaBFt7Y"

Example response:

{
  "count": 2
}

List all permissions

Returns a list of all permissions.

GET /api/v2/permission

Arguments:

This method has no additional arguments.

Response object:

  • An array of Permission objects
  • Each entry in the array is an object with the following properties:
    • id - string : The unique identifier of the permission
    • createdAt - timestamp - When this permission was created
    • startsAt - timestamp : When this permission is set to start
    • expiresAt - timestamp : When this permission is set to expire
    • person - object : The Person object to whom this permission is granted
      • id - string : The unique identifier of the person
      • name - string : The name of the person
      • username - string : The username of the person
      • email - string : The email address of the person
    • dataSource - object : The Data Source object onto which this permission is granted
      • id - string : The unique identifier of the data source
      • name - string : The name of the data source
      • alias - string : The alias of the data source

Example request:

$ curl \
    -H "Accept: application/vnd.jackdb.v2+json" \
    -u "${JACKDB_API_KEY_ID}@api:${JACKDB_API_KEY_SECRET}" \
    "${JACKDB_API_URL}/permission"

Example response:

[
  {
    "id": "19213",
    "createdAt": "2015-03-13T13:57:07.858Z",
    "startsAt": "2015-03-13T13:57:07.858Z",
    "expiresAt": "2015-03-13T15:03:47.858Z",
    "person": {
      "id": "P7ueWXlRjejZU3Yzt",
      "name": "Alexia Buckner",
      "username": "abuckner",
      "email": "alexia.buckner@example.com"
    },
    "dataSource": {
      "id": "DUGC6IqGQ4DX00Lt0",
      "name": "General Ledger",
      "alias": "gl-prod"
    }
  },
  {
    "id": "19218",
    "createdAt": "2015-03-13T13:57:28.216Z",
    "expiresAt": "2015-03-14T13:57:28.216Z",
    "person": {
      "id": "PTbjsa5vR6Hu5aIT5",
      "name": "Zayne Tran",
      "username": "ztran",
      "email": "zayne.tran@example.com"
    },
    "dataSource": {
      "id": "DUGC6IqGQ4DX00Lt0",
      "name": "General Ledger",
      "alias": "gl-prod",
    }
  }
]

List all permissions (specific)

Returns a list of all permissions granting access to a data source to a specific person.

GET /api/v2/data-source/:data-source/permission/person/:person

Arguments:

  • data-source - The identifier of a data source
  • person - The identifier of a person

Response object:

  • An array of Permission objects
  • Each entry in the array is an object with the following properties:
    • id - string : The unique identifier of the permission
    • personId - string : The unique identifier of the person
    • dataSourceId - string : The unique identifier of the data source
    • startsAt - timestamp : When the permission is set to start
    • expiresAt - timestamp : When the permission is set to expire

Example request:

$ curl \
    -H "Accept: application/vnd.jackdb.v2+json" \
    -u "${JACKDB_API_KEY_ID}@api:${JACKDB_API_KEY_SECRET}" \
    "${JACKDB_API_URL}/data-source/DUGC6IqGQ4DX00Lt0/permission/person/P0cKFCMIHoNaBFt7Y"

Example response:

[
  {
    "id": "68939",
    "personId": "P0cKFCMIHoNaBFt7Y",
    "dataSourceId": "DUGC6IqGQ4DX00Lt0",
    "startsAt": "2015-03-12T23:47:14.120Z",
    "expiresAt": "2015-03-13T00:47:14.120Z"
  },
  {
    "id": "69303",
    "personId": "P0cKFCMIHoNaBFt7Y",
    "dataSourceId": "DUGC6IqGQ4DX00Lt0",
    "startsAt": "2015-03-12T23:47:14.120Z",
    "expiresAt": "2015-03-13T00:47:15.193Z"
  }
]

Retrieve a permission

Retrieves the details of an existing permission.

GET /api/v2/permission/:permission

Arguments:

  • permission - The identifier of the permission to be retrieved

Response object:

  • A Permission object with the following properties:
    • id - string : The unique identifier of the permission
    • createdAt - timestamp - When this permission was created
    • expiresAt - timestamp : When this permission is set to expire
    • person - object : The Person object to whom this permission is granted
      • id - string : The unique identifier of the person
      • name - string : The name of the person
      • username - string : The username of the person
      • email - string : The email address of the person
    • dataSource - object : The Data Source object onto which this permission is granted
      • id - string : The unique identifier of the data source
      • name - string : The name of the data source
      • alias - string : The alias of the data source

Example request:

$ curl \
    -H "Accept: application/vnd.jackdb.v2+json" \
    -u "${JACKDB_API_KEY_ID}@api:${JACKDB_API_KEY_SECRET}" \
    "${JACKDB_API_URL}/permission/19213"

Example response:

{
  "id": "19213",
  "createdAt": "2015-03-13T13:57:07.858Z",
  "expiresAt": "2015-03-13T15:03:47.858Z",
  "person": {
    "id": "P7ueWXlRjejZU3Yzt",
    "name": "Alexia Buckner",
    "username": "abuckner",
    "email": "alexia.buckner@example.com"
  },
  "dataSource": {
    "id": "DUGC6IqGQ4DX00Lt0",
    "name": "General Ledger",
    "alias": "gl-prod"
  }
}