Report usage for an entitlement
curl --request PUT \
--url https://dev-entitlements-api.iqraa.ai/api/v1/api/v1/sub-entitlement/usage \
--header 'Content-Type: application/json' \
--header 'x-admin-api-key: <x-admin-api-key>' \
--data '
{
"subscriptionId": "123e4567-e89b-12d3-a456-426614174000",
"entitlementCode": "storage_quota",
"usage": 100
}
'import requests
url = "https://dev-entitlements-api.iqraa.ai/api/v1/api/v1/sub-entitlement/usage"
payload = {
"subscriptionId": "123e4567-e89b-12d3-a456-426614174000",
"entitlementCode": "storage_quota",
"usage": 100
}
headers = {
"x-admin-api-key": "<x-admin-api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-admin-api-key': '<x-admin-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
subscriptionId: '123e4567-e89b-12d3-a456-426614174000',
entitlementCode: 'storage_quota',
usage: 100
})
};
fetch('https://dev-entitlements-api.iqraa.ai/api/v1/api/v1/sub-entitlement/usage', 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://dev-entitlements-api.iqraa.ai/api/v1/api/v1/sub-entitlement/usage",
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([
'subscriptionId' => '123e4567-e89b-12d3-a456-426614174000',
'entitlementCode' => 'storage_quota',
'usage' => 100
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-admin-api-key: <x-admin-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://dev-entitlements-api.iqraa.ai/api/v1/api/v1/sub-entitlement/usage"
payload := strings.NewReader("{\n \"subscriptionId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"entitlementCode\": \"storage_quota\",\n \"usage\": 100\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-admin-api-key", "<x-admin-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://dev-entitlements-api.iqraa.ai/api/v1/api/v1/sub-entitlement/usage")
.header("x-admin-api-key", "<x-admin-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"subscriptionId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"entitlementCode\": \"storage_quota\",\n \"usage\": 100\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev-entitlements-api.iqraa.ai/api/v1/api/v1/sub-entitlement/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-admin-api-key"] = '<x-admin-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"subscriptionId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"entitlementCode\": \"storage_quota\",\n \"usage\": 100\n}"
response = http.request(request)
puts response.read_bodySubscription Entitlements
Report usage for an entitlement
Updates the usage count for a specific entitlement
PUT
/
api
/
v1
/
sub-entitlement
/
usage
Report usage for an entitlement
curl --request PUT \
--url https://dev-entitlements-api.iqraa.ai/api/v1/api/v1/sub-entitlement/usage \
--header 'Content-Type: application/json' \
--header 'x-admin-api-key: <x-admin-api-key>' \
--data '
{
"subscriptionId": "123e4567-e89b-12d3-a456-426614174000",
"entitlementCode": "storage_quota",
"usage": 100
}
'import requests
url = "https://dev-entitlements-api.iqraa.ai/api/v1/api/v1/sub-entitlement/usage"
payload = {
"subscriptionId": "123e4567-e89b-12d3-a456-426614174000",
"entitlementCode": "storage_quota",
"usage": 100
}
headers = {
"x-admin-api-key": "<x-admin-api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'x-admin-api-key': '<x-admin-api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
subscriptionId: '123e4567-e89b-12d3-a456-426614174000',
entitlementCode: 'storage_quota',
usage: 100
})
};
fetch('https://dev-entitlements-api.iqraa.ai/api/v1/api/v1/sub-entitlement/usage', 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://dev-entitlements-api.iqraa.ai/api/v1/api/v1/sub-entitlement/usage",
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([
'subscriptionId' => '123e4567-e89b-12d3-a456-426614174000',
'entitlementCode' => 'storage_quota',
'usage' => 100
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-admin-api-key: <x-admin-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://dev-entitlements-api.iqraa.ai/api/v1/api/v1/sub-entitlement/usage"
payload := strings.NewReader("{\n \"subscriptionId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"entitlementCode\": \"storage_quota\",\n \"usage\": 100\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("x-admin-api-key", "<x-admin-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://dev-entitlements-api.iqraa.ai/api/v1/api/v1/sub-entitlement/usage")
.header("x-admin-api-key", "<x-admin-api-key>")
.header("Content-Type", "application/json")
.body("{\n \"subscriptionId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"entitlementCode\": \"storage_quota\",\n \"usage\": 100\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://dev-entitlements-api.iqraa.ai/api/v1/api/v1/sub-entitlement/usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["x-admin-api-key"] = '<x-admin-api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"subscriptionId\": \"123e4567-e89b-12d3-a456-426614174000\",\n \"entitlementCode\": \"storage_quota\",\n \"usage\": 100\n}"
response = http.request(request)
puts response.read_bodyHeaders
The API key to access the admin API
Body
application/json
Response
Usage reported successfully
⌘I