Update user institution preferences
curl --request PUT \
--url https://pria.praxislxp.com/api/user/userInstitution/{id} \
--header 'Content-Type: application/json' \
--header 'x-access-token: <api-key>' \
--data '
{
"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"
},
"favoriteAssistants": [
"<string>"
],
"acceptedAccountPrivacyPolicyDate": "2023-11-07T05:31:56Z",
"favorite": true
}
'import requests
url = "https://pria.praxislxp.com/api/user/userInstitution/{id}"
payload = {
"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"
},
"favoriteAssistants": ["<string>"],
"acceptedAccountPrivacyPolicyDate": "2023-11-07T05:31:56Z",
"favorite": True
}
headers = {
"x-access-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
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'
},
favoriteAssistants: ['<string>'],
acceptedAccountPrivacyPolicyDate: '2023-11-07T05:31:56Z',
favorite: true
})
};
fetch('https://pria.praxislxp.com/api/user/userInstitution/{id}', 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/userInstitution/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'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'
],
'favoriteAssistants' => [
'<string>'
],
'acceptedAccountPrivacyPolicyDate' => '2023-11-07T05:31:56Z',
'favorite' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://pria.praxislxp.com/api/user/userInstitution/{id}"
payload := strings.NewReader("{\n \"lastConversation\": {\n \"course_id\": 123,\n \"course_name\": \"<string>\",\n \"assistant\": {\n \"_id\": \"<string>\",\n \"name\": \"<string>\",\n \"picture_url\": \"<string>\"\n },\n \"history_count\": 123,\n \"last_dialogue_date\": \"2023-11-07T05:31:56Z\"\n },\n \"canvasApiToken\": {\n \"access_token\": \"24379~vCERVnFWh9yyEVQkafGWQL8WwUk9YKv2mEmMyv6WtkzUYkEHDRGtPP2aMMCYf4C9\",\n \"token_type\": \"Bearer\",\n \"user\": {\n \"id\": 110,\n \"name\": \"Hugo Lebegue\",\n \"global_id\": \"243790000000000110\",\n \"effective_locale\": \"en\",\n \"fake_student\": false\n },\n \"institutionid\": \"65cfebc32f5e1b37d4e52329\",\n \"canvas_region\": \"us-east-1\",\n \"expires_in\": 3600,\n \"created\": 1,\n \"refresh_token\": \"24379~MTDRu7Aw3RGk2DPmrNuAP2E37LcRHQ2A2wk978CMK3GTMFwkrJA8wQkeaKmxWvRA\"\n },\n \"favoriteAssistants\": [\n \"<string>\"\n ],\n \"acceptedAccountPrivacyPolicyDate\": \"2023-11-07T05:31:56Z\",\n \"favorite\": true\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-access-token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://pria.praxislxp.com/api/user/userInstitution/{id}")
.header("x-access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"lastConversation\": {\n \"course_id\": 123,\n \"course_name\": \"<string>\",\n \"assistant\": {\n \"_id\": \"<string>\",\n \"name\": \"<string>\",\n \"picture_url\": \"<string>\"\n },\n \"history_count\": 123,\n \"last_dialogue_date\": \"2023-11-07T05:31:56Z\"\n },\n \"canvasApiToken\": {\n \"access_token\": \"24379~vCERVnFWh9yyEVQkafGWQL8WwUk9YKv2mEmMyv6WtkzUYkEHDRGtPP2aMMCYf4C9\",\n \"token_type\": \"Bearer\",\n \"user\": {\n \"id\": 110,\n \"name\": \"Hugo Lebegue\",\n \"global_id\": \"243790000000000110\",\n \"effective_locale\": \"en\",\n \"fake_student\": false\n },\n \"institutionid\": \"65cfebc32f5e1b37d4e52329\",\n \"canvas_region\": \"us-east-1\",\n \"expires_in\": 3600,\n \"created\": 1,\n \"refresh_token\": \"24379~MTDRu7Aw3RGk2DPmrNuAP2E37LcRHQ2A2wk978CMK3GTMFwkrJA8wQkeaKmxWvRA\"\n },\n \"favoriteAssistants\": [\n \"<string>\"\n ],\n \"acceptedAccountPrivacyPolicyDate\": \"2023-11-07T05:31:56Z\",\n \"favorite\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pria.praxislxp.com/api/user/userInstitution/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"lastConversation\": {\n \"course_id\": 123,\n \"course_name\": \"<string>\",\n \"assistant\": {\n \"_id\": \"<string>\",\n \"name\": \"<string>\",\n \"picture_url\": \"<string>\"\n },\n \"history_count\": 123,\n \"last_dialogue_date\": \"2023-11-07T05:31:56Z\"\n },\n \"canvasApiToken\": {\n \"access_token\": \"24379~vCERVnFWh9yyEVQkafGWQL8WwUk9YKv2mEmMyv6WtkzUYkEHDRGtPP2aMMCYf4C9\",\n \"token_type\": \"Bearer\",\n \"user\": {\n \"id\": 110,\n \"name\": \"Hugo Lebegue\",\n \"global_id\": \"243790000000000110\",\n \"effective_locale\": \"en\",\n \"fake_student\": false\n },\n \"institutionid\": \"65cfebc32f5e1b37d4e52329\",\n \"canvas_region\": \"us-east-1\",\n \"expires_in\": 3600,\n \"created\": 1,\n \"refresh_token\": \"24379~MTDRu7Aw3RGk2DPmrNuAP2E37LcRHQ2A2wk978CMK3GTMFwkrJA8wQkeaKmxWvRA\"\n },\n \"favoriteAssistants\": [\n \"<string>\"\n ],\n \"acceptedAccountPrivacyPolicyDate\": \"2023-11-07T05:31:56Z\",\n \"favorite\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "userInstitution preference saved sucessfully"
}{
"success": false,
"message": "Specify a valid property to update ex: (canvasApiToken, lastConversation, acceptedAccountPrivacyPolicyDate, favoriteAssistants)"
}{
"success": false,
"message": "Authentication Required"
}{
"success": false,
"message": "Not Yours!"
}{
"success": false,
"message": "Not Found"
}User Institutions
Update user institution preferences
Updates user-institution settings. Accepts canvasApiToken (object to set, empty string to remove), lastConversation, favoriteAssistants, acceptedAccountPrivacyPolicyDate, and favorite. At least one valid field must be provided.
PUT
/
api
/
user
/
userInstitution
/
{id}
Update user institution preferences
curl --request PUT \
--url https://pria.praxislxp.com/api/user/userInstitution/{id} \
--header 'Content-Type: application/json' \
--header 'x-access-token: <api-key>' \
--data '
{
"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"
},
"favoriteAssistants": [
"<string>"
],
"acceptedAccountPrivacyPolicyDate": "2023-11-07T05:31:56Z",
"favorite": true
}
'import requests
url = "https://pria.praxislxp.com/api/user/userInstitution/{id}"
payload = {
"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"
},
"favoriteAssistants": ["<string>"],
"acceptedAccountPrivacyPolicyDate": "2023-11-07T05:31:56Z",
"favorite": True
}
headers = {
"x-access-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-access-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
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'
},
favoriteAssistants: ['<string>'],
acceptedAccountPrivacyPolicyDate: '2023-11-07T05:31:56Z',
favorite: true
})
};
fetch('https://pria.praxislxp.com/api/user/userInstitution/{id}', 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/userInstitution/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'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'
],
'favoriteAssistants' => [
'<string>'
],
'acceptedAccountPrivacyPolicyDate' => '2023-11-07T05:31:56Z',
'favorite' => true
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://pria.praxislxp.com/api/user/userInstitution/{id}"
payload := strings.NewReader("{\n \"lastConversation\": {\n \"course_id\": 123,\n \"course_name\": \"<string>\",\n \"assistant\": {\n \"_id\": \"<string>\",\n \"name\": \"<string>\",\n \"picture_url\": \"<string>\"\n },\n \"history_count\": 123,\n \"last_dialogue_date\": \"2023-11-07T05:31:56Z\"\n },\n \"canvasApiToken\": {\n \"access_token\": \"24379~vCERVnFWh9yyEVQkafGWQL8WwUk9YKv2mEmMyv6WtkzUYkEHDRGtPP2aMMCYf4C9\",\n \"token_type\": \"Bearer\",\n \"user\": {\n \"id\": 110,\n \"name\": \"Hugo Lebegue\",\n \"global_id\": \"243790000000000110\",\n \"effective_locale\": \"en\",\n \"fake_student\": false\n },\n \"institutionid\": \"65cfebc32f5e1b37d4e52329\",\n \"canvas_region\": \"us-east-1\",\n \"expires_in\": 3600,\n \"created\": 1,\n \"refresh_token\": \"24379~MTDRu7Aw3RGk2DPmrNuAP2E37LcRHQ2A2wk978CMK3GTMFwkrJA8wQkeaKmxWvRA\"\n },\n \"favoriteAssistants\": [\n \"<string>\"\n ],\n \"acceptedAccountPrivacyPolicyDate\": \"2023-11-07T05:31:56Z\",\n \"favorite\": true\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-access-token", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://pria.praxislxp.com/api/user/userInstitution/{id}")
.header("x-access-token", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"lastConversation\": {\n \"course_id\": 123,\n \"course_name\": \"<string>\",\n \"assistant\": {\n \"_id\": \"<string>\",\n \"name\": \"<string>\",\n \"picture_url\": \"<string>\"\n },\n \"history_count\": 123,\n \"last_dialogue_date\": \"2023-11-07T05:31:56Z\"\n },\n \"canvasApiToken\": {\n \"access_token\": \"24379~vCERVnFWh9yyEVQkafGWQL8WwUk9YKv2mEmMyv6WtkzUYkEHDRGtPP2aMMCYf4C9\",\n \"token_type\": \"Bearer\",\n \"user\": {\n \"id\": 110,\n \"name\": \"Hugo Lebegue\",\n \"global_id\": \"243790000000000110\",\n \"effective_locale\": \"en\",\n \"fake_student\": false\n },\n \"institutionid\": \"65cfebc32f5e1b37d4e52329\",\n \"canvas_region\": \"us-east-1\",\n \"expires_in\": 3600,\n \"created\": 1,\n \"refresh_token\": \"24379~MTDRu7Aw3RGk2DPmrNuAP2E37LcRHQ2A2wk978CMK3GTMFwkrJA8wQkeaKmxWvRA\"\n },\n \"favoriteAssistants\": [\n \"<string>\"\n ],\n \"acceptedAccountPrivacyPolicyDate\": \"2023-11-07T05:31:56Z\",\n \"favorite\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pria.praxislxp.com/api/user/userInstitution/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-access-token"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"lastConversation\": {\n \"course_id\": 123,\n \"course_name\": \"<string>\",\n \"assistant\": {\n \"_id\": \"<string>\",\n \"name\": \"<string>\",\n \"picture_url\": \"<string>\"\n },\n \"history_count\": 123,\n \"last_dialogue_date\": \"2023-11-07T05:31:56Z\"\n },\n \"canvasApiToken\": {\n \"access_token\": \"24379~vCERVnFWh9yyEVQkafGWQL8WwUk9YKv2mEmMyv6WtkzUYkEHDRGtPP2aMMCYf4C9\",\n \"token_type\": \"Bearer\",\n \"user\": {\n \"id\": 110,\n \"name\": \"Hugo Lebegue\",\n \"global_id\": \"243790000000000110\",\n \"effective_locale\": \"en\",\n \"fake_student\": false\n },\n \"institutionid\": \"65cfebc32f5e1b37d4e52329\",\n \"canvas_region\": \"us-east-1\",\n \"expires_in\": 3600,\n \"created\": 1,\n \"refresh_token\": \"24379~MTDRu7Aw3RGk2DPmrNuAP2E37LcRHQ2A2wk978CMK3GTMFwkrJA8wQkeaKmxWvRA\"\n },\n \"favoriteAssistants\": [\n \"<string>\"\n ],\n \"acceptedAccountPrivacyPolicyDate\": \"2023-11-07T05:31:56Z\",\n \"favorite\": true\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "userInstitution preference saved sucessfully"
}{
"success": false,
"message": "Specify a valid property to update ex: (canvasApiToken, lastConversation, acceptedAccountPrivacyPolicyDate, favoriteAssistants)"
}{
"success": false,
"message": "Authentication Required"
}{
"success": false,
"message": "Not Yours!"
}{
"success": false,
"message": "Not Found"
}Authorizations
JWT token passed in x-access-token header
Path Parameters
The UserInstitution ObjectId to update
Body
application/json
At least one field is required. If no valid fields are provided, a 400 error is returned.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Array of assistant ObjectIds to mark as favorites
Date when user accepted the account privacy policy
Whether to mark this institution as a favorite
Was this page helpful?
Generate an AI summary title for a history record or conversationUnlink LTI context from user institution
⌘I