Skip to main content
GET
/
customers
/
{customerID}
/
subroles
Get Customer Subroles
curl --request GET \
  --url https://api.joinworth.com/auth/api/v1/customers/{customerID}/subroles \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.joinworth.com/auth/api/v1/customers/{customerID}/subroles"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.joinworth.com/auth/api/v1/customers/{customerID}/subroles', 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.joinworth.com/auth/api/v1/customers/{customerID}/subroles",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
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;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.joinworth.com/auth/api/v1/customers/{customerID}/subroles"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.joinworth.com/auth/api/v1/customers/{customerID}/subroles")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.joinworth.com/auth/api/v1/customers/{customerID}/subroles")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "status": "success",
  "message": "Customer subroles fetched successfully.",
  "data": [
    {
      "code": "cro",
      "label": "CRO",
      "id": "cdc69893-6d14-4ba5-a8a8-a0ba79f966b0",
      "display_name": "CRO"
    },
    {
      "code": "risk_analyst",
      "label": "Risk Analyst",
      "id": "cececa89-aa54-4433-8184-ec0598392811",
      "display_name": "Risk Analyst"
    }
  ]
}
{
"status": "fail",
"message": "Customer does not exists",
"errorCode": "INVALID",
"data": {
"errorName": "CustomersApiError"
}
}
{
"message": "Unauthorized",
"errorCode": "ERR_UNAUTHORIZED"
}
{
"message": "Forbidden",
"errorCode": "ERR_FORBIDDEN"
}
{
"message": "Internal Server Error",
"errorCode": "ERR_INTERNAL_SERVER"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

customerID
string<uuid>
required

Response

OK

status
string
Example:

"success"

message
string
Example:

"Customer subroles fetched successfully."

data
object[]