Consent Management

Consent Update

post

This API is used to update user consent for sharing the PII to an organisation, course or collection

  • The endpoint for Update Consent is /user/v1/consent/update
  • The fields marked with an asterisk (*) are mandatory. They cannot be null or empty.
Authorizations
Header parameters
tsstringOptional

Timestamp at which given API request is sent.

X-msgidstringOptional

This ID uniquely identifies a request if the same API is executed multiple times.

AuthorizationstringRequired

To make use of this API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.

x-authenticated-user-tokenstringRequired

It is a unique token/key to authenticate the user each time an API is called. For corresponding sessions this token is used, not your actual username/password

x-authenticated-forstringOptional

Managed User token of registered MUA user performing given API request.

Body
Responses
200
Consent update success response
application/json
post
POST /api/user/v1/consent/update HTTP/1.1
Host: staging.open-sunbird.org
Authorization: text
x-authenticated-user-token: text
Content-Type: application/json
Accept: */*
Content-Length: 189

{
  "request": {
    "consent": {
      "status": "ACTIVE",
      "userId": "e94ad69a-9096-491c-b107-782a67760a2b",
      "consumerId": 126632859575746560,
      "objectId": "do_31313966505806233613406",
      "objectType": "Collection"
    }
  }
}
{
  "id": "api.user.consent.update",
  "ver": "v1",
  "ts": "2020-09-17 14:07:15:545+0000",
  "params": {
    "resmsgid": null,
    "msgid": "3d1afc39-9350-4565-afb3-735dbccd19c7",
    "err": null,
    "status": "success",
    "errmsg": null
  },
  "responseCode": "OK",
  "result": {
    "consent": {
      "userId": "e94ad69a-9096-491c-b107-782a67760a2b"
    },
    "message": "User Consent updated successfully."
  }
}

UserConsentRead

post
Authorizations
Header parameters
tsstringOptional

Timestamp at which given API request is sent.

X-msgidstringOptional

This ID uniquely identifies a request if the same API is executed multiple times.

AuthorizationstringRequired

To make use of this API, you require authorization. Raise a request to the administrator for the use of the API. You will receive the authorization key. Specify the key received, here.

x-authenticated-user-tokenstringRequired

It is a unique token/key to authenticate the user each time an API is called. For corresponding sessions this token is used, not your actual username/password

x-authenticated-forstringOptional

Managed User token of registered MUA user performing given API request.

Body
Responses
200Success
application/json
post
POST /api/user/v1/consent/read HTTP/1.1
Host: staging.open-sunbird.org
Authorization: text
x-authenticated-user-token: text
Content-Type: application/json
Accept: */*
Content-Length: 157

{
  "request": {
    "consent": {
      "filters": {
        "userId": "5a8a3f2b-3409-42e0-9001-f913bc0fde31",
        "consumerId": 126632859575746560,
        "objectId": "do_31313966505806233613406"
      }
    }
  }
}
{
  "id": "api.user.consent.read",
  "ver": "v1",
  "ts": "2020-09-17 14:11:19:029+0000",
  "params": {
    "resmsgid": null,
    "msgid": "dfb32305-cb9f-470a-b52b-fe492ca89415",
    "err": null,
    "status": "success",
    "errmsg": null
  },
  "responseCode": "OK",
  "result": {
    "consents": [
      {
        "userId": "5a8a3f2b-3409-42e0-9001-f913bc0fde31",
        "consumerId": 126632859575746560,
        "status": "ACTIVE",
        "objectType": "Collection",
        "objectId": "do_31313966505806233613406"
      }
    ]
  }
}

Last updated

Was this helpful?