Set a cookie for the data subject session

GET https://api.consentgrid.io/v1/session/<acct>/feedme?redirect=redirectURL
Authorization: Bearer apiKey

Responds with an HTTP redirect to the given redirectURL and sets a cookie. The cookie can be used by the front-end to call some of the data subject related APIs to retrieve data without further authentication.

Session Cookies

Here's how data subject sessions work:

  • Call the createSession API from your backend:
    GET https://api.consentgrid.io/v1/session/for/subject/user/63cb0004-544b-45bd-938c-3e1b9c07fea7?redirect=https://myapp.com/page
  • The API returns a token, and a redirection URL:
    {
      "token": "eyJhb...",
      "url": "https://api.consentgrid.io/v1/session//feedme?token=eyJhb...&redirect=https://myapp.com/page"
    }
  • Use url field contents to send HTTP redirect to your front-end.
  • ConsentGrid™ sets a cookie for the user, and redirects back to https://myapp.com/page.
  • Use AJAX to call ConsentGrid™ APIs:
    $.ajax({url:"https://api.consentgrid.io/v1/...",
      xhrFields: {
         withCredentials: true
      }
      ...

Response

200 Ok
302 Found
400 Bad Request

Malformed request, invalid value, etc. The return value is a JSON error object containing diagnostic information.

403 Forbidden

The authenticated key does not have the privileges for this operation. The return value is a JSON error object containing diagnostic information.