Skip to main content
POST
/
api
/
user
/
refresh
/
entitlements
Refresh user entitlements and permissions
curl --request POST \
  --url https://pria.praxislxp.com/api/user/refresh/entitlements \
  --header 'x-access-token: <api-key>'
import requests

url = "https://pria.praxislxp.com/api/user/refresh/entitlements"

headers = {"x-access-token": "<api-key>"}

response = requests.post(url, headers=headers)

print(response.text)
const options = {method: 'POST', headers: {'x-access-token': '<api-key>'}};

fetch('https://pria.praxislxp.com/api/user/refresh/entitlements', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://pria.praxislxp.com/api/user/refresh/entitlements",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-access-token: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://pria.praxislxp.com/api/user/refresh/entitlements"

req, _ := http.NewRequest("POST", url, nil)

req.Header.Add("x-access-token", "<api-key>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://pria.praxislxp.com/api/user/refresh/entitlements")
.header("x-access-token", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://pria.praxislxp.com/api/user/refresh/entitlements")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-access-token"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "success": true,
  "entitlements": [
    {
      "_id": "<string>",
      "entitlements": [
        "<string>"
      ],
      "user": "<string>",
      "institution": "<string>",
      "institution_data": {
        "_id": "<string>",
        "name": "<string>",
        "ainame": "<string>"
      },
      "account_data": {
        "_id": "<string>",
        "name": "<string>"
      },
      "created": "2023-11-07T05:31:56Z",
      "lastLogin": "2023-11-07T05:31:56Z",
      "lastKA": "2023-11-07T05:31:56Z",
      "favorite": true,
      "favoriteAssistants": [
        "<string>"
      ],
      "acceptedAccountPrivacyPolicyDate": "2023-11-07T05:31:56Z",
      "creditAwardedDate": "2023-11-07T05:31:56Z",
      "lticontextid": "<string>",
      "lastConversation": {
        "course_id": 123,
        "course_name": "<string>",
        "assistant": {
          "_id": "<string>",
          "name": "<string>",
          "picture_url": "<string>"
        },
        "history_count": 123,
        "last_dialogue_date": "2023-11-07T05:31:56Z"
      },
      "canvasApiToken": {
        "access_token": "24379~vCERVnFWh9yyEVQkafGWQL8WwUk9YKv2mEmMyv6WtkzUYkEHDRGtPP2aMMCYf4C9",
        "token_type": "Bearer",
        "user": {
          "id": 110,
          "name": "Hugo Lebegue",
          "global_id": "243790000000000110",
          "effective_locale": "en",
          "fake_student": false
        },
        "institutionid": "65cfebc32f5e1b37d4e52329",
        "canvas_region": "us-east-1",
        "expires_in": 3600,
        "created": 1,
        "refresh_token": "24379~MTDRu7Aw3RGk2DPmrNuAP2E37LcRHQ2A2wk978CMK3GTMFwkrJA8wQkeaKmxWvRA"
      },
      "digitaltwinrole": "<string>",
      "joinedAt": "2023-11-07T05:31:56Z"
    }
  ],
  "accountManagerAccounts": [
    {
      "_id": "<string>",
      "name": "<string>"
    }
  ]
}
{
"success": false,
"error": {},
"message": "<string>"
}
{
"success": false,
"message": "Authentication required"
}

Authorizations

x-access-token
string
header
required

JWT token passed in x-access-token header

Response

Successfully refreshed user entitlements

success
boolean

Indicates if the operation was successful

entitlements
object[]

Array of user-institution records, sorted by favorite (desc), ainame (asc), institution name (asc). Null-institution duplicates are auto-cleaned.

accountManagerAccounts
object[]

Accounts where this user is an account manager (array of {_id, name} objects)