curl --request GET \
--url https://hiimpria.ai/api/auth/token_completeimport requests
url = "https://hiimpria.ai/api/auth/token_complete"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://hiimpria.ai/api/auth/token_complete', 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://hiimpria.ai/api/auth/token_complete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://hiimpria.ai/api/auth/token_complete"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://hiimpria.ai/api/auth/token_complete")
.asString();require 'uri'
require 'net/http'
url = URI("https://hiimpria.ai/api/auth/token_complete")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body<string><string><string>Complete the Canvas LMS API authorization handoff
Canvas sends the person’s browser here after they authorize the Digital Twin to call the Canvas API on their behalf (Canvas OAuth2 authorization-code flow): when they open the twin from a Canvas course that requires the Canvas sign-in, or when a Canvas course tool in a chat gives them a sign-in link. The code is exchanged for a Canvas API token, which is stored for that person in that Digital Twin.
A Canvas sign-in link works once and for 10 minutes. Its state is a random value that
names nobody: the person and the Digital Twin come from the link itself, never from the
address. A newer link replaces the earlier one.
A link is accepted only for the Canvas account the course opened the Digital Twin for (for a course tool’s link, on a Digital Twin that asks for the Canvas sign-in); signing in to Canvas with another account connects nothing.
This is not a Pria sign-in: the answer is a small HTML page either way.
Configuration requirements: the Digital Twin (or its parent account) must have
canvasClientId and canvasClientSecret set, and a derivable Canvas API domain (an
instructure.com URL or a .edu vanity URL in publicAuthorizedUrls).
curl --request GET \
--url https://hiimpria.ai/api/auth/token_completeimport requests
url = "https://hiimpria.ai/api/auth/token_complete"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://hiimpria.ai/api/auth/token_complete', 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://hiimpria.ai/api/auth/token_complete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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://hiimpria.ai/api/auth/token_complete"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://hiimpria.ai/api/auth/token_complete")
.asString();require 'uri'
require 'net/http'
url = URI("https://hiimpria.ai/api/auth/token_complete")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body<string><string><string>Query Parameters
Canvas OAuth authorization code to exchange for an access token.
The single-use value of the sign-in link (64 hexadecimal characters). It does not identify the person: an unknown, expired or already used value is refused.
Set by Canvas when the person declines the consent screen (the link is then spent).
Human-readable failure reason that accompanies error.
Response
Canvas token stored. An HTML page that sends the person back to the app.
The response is of type string.
Was this page helpful?