Agent auth
Exchange OTP for agent credential
Completes the user-claimed flow. 5 wrong codes lock the registration. Codes expire after 10 minutes.
POST
/
agent
/
auth
/
claim
/
complete
Exchange OTP for agent credential
curl --request POST \
--url https://api.hookmyapp.com/agent/auth/claim/complete \
--header 'Content-Type: application/json' \
--data '
{
"registrationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"otp": "<string>"
}
'import requests
url = "https://api.hookmyapp.com/agent/auth/claim/complete"
payload = {
"registrationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"otp": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({registrationId: '3c90c3cc-0d44-4b50-8888-8dd25736052a', otp: '<string>'})
};
fetch('https://api.hookmyapp.com/agent/auth/claim/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://api.hookmyapp.com/agent/auth/claim/complete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'registrationId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'otp' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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://api.hookmyapp.com/agent/auth/claim/complete"
payload := strings.NewReader("{\n \"registrationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"otp\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.post("https://api.hookmyapp.com/agent/auth/claim/complete")
.header("Content-Type", "application/json")
.body("{\n \"registrationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"otp\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hookmyapp.com/agent/auth/claim/complete")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"registrationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"otp\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"accessToken": "<string>",
"tokenType": "Bearer",
"organizationPublicId": "<string>",
"userId": "<string>",
"scopes": [],
"credentialPublicId": "<string>"
}{
"statusCode": 403,
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
}{
"statusCode": 403,
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
}Response
Credential issued
The hmok_ Bearer token. Shown once. Store it because headless-minted keys cannot be revealed again.
Available options:
Bearer The organization public ID (org_...) to use in organization-scoped API routes.
Available options:
workspace.create, workspace.read, workspace.delete, workspace.reclassify, channel.connect, channel.read, channel.manage, messages.read, billing.read, billing.manage, member.invite, member.manage, team.read, team.manage, support.read, support.write ⌘I
Exchange OTP for agent credential
curl --request POST \
--url https://api.hookmyapp.com/agent/auth/claim/complete \
--header 'Content-Type: application/json' \
--data '
{
"registrationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"otp": "<string>"
}
'import requests
url = "https://api.hookmyapp.com/agent/auth/claim/complete"
payload = {
"registrationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"otp": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({registrationId: '3c90c3cc-0d44-4b50-8888-8dd25736052a', otp: '<string>'})
};
fetch('https://api.hookmyapp.com/agent/auth/claim/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://api.hookmyapp.com/agent/auth/claim/complete",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'registrationId' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'otp' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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://api.hookmyapp.com/agent/auth/claim/complete"
payload := strings.NewReader("{\n \"registrationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"otp\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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.post("https://api.hookmyapp.com/agent/auth/claim/complete")
.header("Content-Type", "application/json")
.body("{\n \"registrationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"otp\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hookmyapp.com/agent/auth/claim/complete")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"registrationId\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"otp\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"accessToken": "<string>",
"tokenType": "Bearer",
"organizationPublicId": "<string>",
"userId": "<string>",
"scopes": [],
"credentialPublicId": "<string>"
}{
"statusCode": 403,
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
}{
"statusCode": 403,
"code": "<string>",
"message": "<string>",
"requestId": "<string>"
}