Skip to main content
POST
/
contact-channels
/
{user_id}
/
{contact_channel_id}
/
send-verification-code
Send contact channel verification code
curl --request POST \
  --url https://api.hexclave.com/api/v1/contact-channels/{user_id}/{contact_channel_id}/send-verification-code \
  --header 'Content-Type: application/json' \
  --data '
{
  "callback_url": "https://example.com/handler/email-verification"
}
'
import requests

url = "https://api.hexclave.com/api/v1/contact-channels/{user_id}/{contact_channel_id}/send-verification-code"

payload = { "callback_url": "https://example.com/handler/email-verification" }
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({callback_url: 'https://example.com/handler/email-verification'})
};

fetch('https://api.hexclave.com/api/v1/contact-channels/{user_id}/{contact_channel_id}/send-verification-code', 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.hexclave.com/api/v1/contact-channels/{user_id}/{contact_channel_id}/send-verification-code",
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([
'callback_url' => 'https://example.com/handler/email-verification'
]),
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.hexclave.com/api/v1/contact-channels/{user_id}/{contact_channel_id}/send-verification-code"

payload := strings.NewReader("{\n \"callback_url\": \"https://example.com/handler/email-verification\"\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.hexclave.com/api/v1/contact-channels/{user_id}/{contact_channel_id}/send-verification-code")
.header("Content-Type", "application/json")
.body("{\n \"callback_url\": \"https://example.com/handler/email-verification\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.hexclave.com/api/v1/contact-channels/{user_id}/{contact_channel_id}/send-verification-code")

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 \"callback_url\": \"https://example.com/handler/email-verification\"\n}"

response = http.request(request)
puts response.read_body
{
  "success": true
}

Path Parameters

user_id
string
required

The user to send the verification code to.

Example:

"me"

contact_channel_id
string
required

The contact channel to send the verification code to.

Example:

"b3d396b8-c574-4c80-97b3-50031675ceb2"

Body

application/json
callback_url
string
required

The base callback URL to construct a verification link for the verification e-mail. A query parameter code with the verification code will be appended to it. The page should then make a request to the /contact-channels/verify endpoint.

Example:

"https://example.com/handler/email-verification"

Response

200 - application/json

Successful response

success
boolean
required

Always equal to true.

Example:

true