cURL
curl -X POST \
/customers/{id}/authenticate \
--header "Authorization: Bearer <token>"import requests
url = "https://coreapi.io/customers/{id}/authenticate"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://coreapi.io/customers/{id}/authenticate', 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://coreapi.io/customers/{id}/authenticate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": {
"accessToken": "<string>",
"refreshToken": "<string>",
"customerAreaLink": "<string>"
}
}Authentication
Generate customer authentication
Generates authentication tokens and a pre-authenticated link to the customer portal. Use this to allow customers to access their portal without entering credentials, or to make API calls on behalf of the customer.
POST
/
customers
/
{id}
/
authenticate
cURL
curl -X POST \
/customers/{id}/authenticate \
--header "Authorization: Bearer <token>"import requests
url = "https://coreapi.io/customers/{id}/authenticate"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://coreapi.io/customers/{id}/authenticate', 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://coreapi.io/customers/{id}/authenticate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"data": {
"accessToken": "<string>",
"refreshToken": "<string>",
"customerAreaLink": "<string>"
}
}Generates authentication tokens and a pre-authenticated link to the customer portal.
Use Cases
- Customer Portal Access: Generate a link that allows customers to access their portal without entering credentials
- API on Behalf of Customer: Use the access token to make API calls on behalf of the customer
- Email Integration: Include the customer area link in emails to provide seamless access
Response
The endpoint returns:| Field | Description |
|---|---|
accessToken | JWT access token for API authentication on behalf of the customer |
refreshToken | JWT refresh token to obtain new access tokens |
customerAreaLink | Pre-authenticated short link to the customer portal |
Example Response
{
"data": {
"accessToken": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
"refreshToken": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
"customerAreaLink": "https://example.customerfront.app/customer-area/login?token=abc123"
}
}
The
customerAreaLink contains a short-lived token. Generate a new link if the customer needs to access the portal at a later time.Use the
accessToken to make API calls on behalf of the customer, for example to retrieve their entitlements or subscriptions.Autorisierungen
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Pfadparameter
Customer identifier
Antwort
Returns authentication tokens and a customer area link for the customer
Show child attributes
Show child attributes
War diese Seite hilfreich?