API Keys

This object represents an API key, it allows you to gain programmatic access to all of Felloh's functions.

The API Key Object

{
"id": "6baa5798-46c7-4701-98a6-c1462f57df0d",
"name": "my_access_key",
"public_key": "22bc9c6eaa2d8aa7ce4a233b0790bc3248fbdab33cb393c7a8gg2b4fd9fcb551",
"secret_key_last_four": "e653",
"created_at": "2022-06-24T09:59:57.891Z",
"user": {
"id": "decc740c-c942-4624-9b5c-b57688a1f356"
}
}

idstring

Unique identifier for the object.

namestring

A human friendly name for the api keys

public_keystring

The public key

secret_key_last_fourstring

The last four digits of the api key

created_atdatetime

The datetime at which the api key object was created within our systems

user.idstring

The user id that all actions of the api key will be linked to


Fetch all

POST/token/keys

import axios from 'axios';
const response = await axios(
{
method: 'post',
url: 'https://api.felloh.com/token/keys',
data: {
organisation: 'X9876',
},
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer <YOUR TOKEN HERE>`,
},
},
);
use GuzzleHttp\Client;
function getTokenKeys($token) {
$client = new Client();
$response = $client->post('https://api.felloh.com/token/keys', [
'headers' => [
'Content-Type' => 'application/json',
'Authorization' => 'Bearer ' . $token,
],
'json' => [
'organisation' => 'X9876',
],
]);
$data = json_decode($response->getBody(), true);
return $data;
}
$token = 'YOUR_TOKEN_HERE'; // Replace with the actual token
$response = getTokenKeys($token);
import requests
import json
def post_token_keys(organisation, access_token):
api_url = 'https://api.felloh.com/token/keys'
headers = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {access_token}'
}
data = {
'organisation': organisation
}
response = requests.post(api_url, headers=headers, data=json.dumps(data))
response.raise_for_status()
return response.text
response_data = post_token_keys('X9876', '<YOUR TOKEN HERE>')
print(response_data)
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
var response = await PostTokenKeys("X9876", "<YOUR TOKEN HERE>");
Console.WriteLine(response);
}
static async Task<string> PostTokenKeys(string organisation, string accessToken)
{
using (HttpClient client = new HttpClient())
{
string apiUrl = "https://api.felloh.com/token/keys";
client.DefaultRequestHeaders.Add("Content-Type", "application/json");
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {accessToken}");
var requestData = new
{
organisation = organisation
};
var content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(requestData), Encoding.UTF8, "application/json");
var httpResponse = await client.PostAsync(apiUrl, content);
httpResponse.EnsureSuccessStatusCode();
return await httpResponse.Content.ReadAsStringAsync();
}
}
}

RESPONSE

{
"data": [
{
"id": "6baa5798-46c7-4701-98a6-c1462f57df0d",
"name": "my_access_key",
"public_key": "22bc9c6eaa2d8aa7ce4a233b0790bc3248fbdab33cb393c7a8gg2b4fd9fcb551",
"secret_key_last_four": "e653",
"created_at": "2022-06-24T09:59:57.891Z",
"user": {
"id": "decc740c-c942-4624-9b5c-b57688a1f356"
}
}
],
"errors": {},
"meta": {
"code": 200,
"reason": "OK",
"message": "The request was successful",
"request_id": "cdd40f5c-9d82-44c2-92e3-b5d2cad364f6",
"count": 1
}
}

This endpoint retrieves all api keys.

HTTP Method

POST

HTTP Endpoint

PRODhttps://api.felloh.com/token/keys

SANDBOXhttps://sandbox.felloh.com/token/keys

Payload

ParameterRequiredTypeDescription
organisationtruestringThe organisation ID that you want to fetch api keys for. You can find the organisation that you have access to by using the List all organisations method.

Response

Returns an array of API Keys Objects


Create one

PUT/token/key

import axios from 'axios';
const response = await axios(
{
method: 'post',
url: 'https://api.felloh.com/token/key',
data: JSON.stringify({
organisation: 'X9876',
name: 'Test Key',
}),
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer <YOUR TOKEN HERE>`,
},
}
);
use GuzzleHttp\Client;
function createTokenKey($token) {
$client = new Client();
$response = $client->post('https://api.felloh.com/token/key', [
'headers' => [
'Content-Type' => 'application/json',
'Authorization' => 'Bearer ' . $token,
],
'json' => [
'organisation' => 'X9876',
'name' => 'Test Key',
],
]);
$data = json_decode($response->getBody(), true);
return $data;
}
$token = 'YOUR_TOKEN_HERE'; // Replace with the actual token
$response = createTokenKey($token);
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
var response = await PostTokenKey("X9876", "Test Key", "<YOUR TOKEN HERE>");
Console.WriteLine(response);
}
static async Task<string> PostTokenKey(string organisation, string keyName, string accessToken)
{
using (HttpClient client = new HttpClient())
{
string apiUrl = "https://api.felloh.com/token/key";
client.DefaultRequestHeaders.Add("Content-Type", "application/json");
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {accessToken}");
var requestData = new
{
organisation = organisation,
name = keyName
};
var content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(requestData), Encoding.UTF8, "application/json");
var httpResponse = await client.PostAsync(apiUrl, content);
httpResponse.EnsureSuccessStatusCode();
return await httpResponse.Content.ReadAsStringAsync();
}
}
}
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
var response = await PostTokenKey("X9876", "Test Key", "<YOUR TOKEN HERE>");
Console.WriteLine(response);
}
static async Task<string> PostTokenKey(string organisation, string keyName, string accessToken)
{
using (HttpClient client = new HttpClient())
{
string apiUrl = "https://api.felloh.com/token/key";
client.DefaultRequestHeaders.Add("Content-Type", "application/json");
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {accessToken}");
var requestData = new
{
organisation = organisation,
name = keyName
};
var content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(requestData), Encoding.UTF8, "application/json");
var httpResponse = await client.PostAsync(apiUrl, content);
httpResponse.EnsureSuccessStatusCode();
return await httpResponse.Content.ReadAsStringAsync();
}
}
}

RESPONSE

{
"data": {
"name": "Test Key",
"public_key": "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDXKkK/TIQ9YhoEoGj7rFwrAxYs7A3DBdc",
"secret_key": "5oMfu26n4VorWC3gNgdDXt6uuVONsA+nPBuvtxe4BUAuv38oI21LGCj/ffJmT2Ie+BhYcK3o1AE/0OFaF80yLEnat2xSoioQkb4zBUP1REEYewRN3CauZ989G"
},
"errors": {},
"meta": {
"code": 200,
"reason": "OK",
"message": "The request was successful",
"request_id": "cdd40f5c-9d82-44c2-92e3-b5d2cad364f6"
}
}

This endpoint allows you to create a new API key for an organisation

HTTP Method

PUT

HTTP Endpoint

PRODhttps://api.felloh.com/token/key

SANDBOXhttps://sandbox.felloh.com/token/key

Payload

ParameterRequiredTypeDescription
organisationtruestringThe organisation ID that you want to create the api key in.
nametruestringThe human friendly name of the api key

Delete one

PUT/token/key

import axios from 'axios';
const keyToDelete = 'd5f8e8f5-fa6f-4c00-b943-60d1855afe85';
const response = await axios(
{
method: 'delete',
url: 'https://api.felloh.com/token/key/${keyToDelete}',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer <YOUR TOKEN HERE>`,
},
}
);
use GuzzleHttp\Client;
function deleteTokenKey($token, $keyToDelete) {
$url = 'https://api.felloh.com/token/key/' . $keyToDelete;
$client = new Client();
$response = $client->delete($url, [
'headers' => [
'Content-Type' => 'application/json',
'Authorization' => 'Bearer ' . $token,
],
]);
$data = json_decode($response->getBody(), true);
return $data;
}
$token = 'YOUR_TOKEN_HERE'; // Replace with the actual token
$keyToDelete = 'd5f8e8f5-fa6f-4c00-b943-60d1855afe85'; // Replace with the actual key you want to delete
$response = deleteTokenKey($token, $keyToDelete);
import requests
def delete_token_key(key_to_delete, access_token):
api_url = f'https://api.felloh.com/token/key/{key_to_delete}'
headers = {
'Content-Type': 'application/json',
'Authorization': f'Bearer {access_token}'
}
response = requests.delete(api_url, headers=headers)
response.raise_for_status()
return response.text
key_to_delete = 'd5f8e8f5-fa6f-4c00-b943-60d1855afe85'
response_data = delete_token_key(key_to_delete, '<YOUR TOKEN HERE>')
print(response_data)
using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
string keyToDelete = "d5f8e8f5-fa6f-4c00-b943-60d1855afe85";
var response = await DeleteTokenKey(keyToDelete, "<YOUR TOKEN HERE>");
Console.WriteLine(response);
}
static async Task<string> DeleteTokenKey(string keyToDelete, string accessToken)
{
using (HttpClient client = new HttpClient())
{
string apiUrl = $"https://api.felloh.com/token/key/{keyToDelete}";
client.DefaultRequestHeaders.Add("Content-Type", "application/json");
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {accessToken}");
var httpResponse = await client.DeleteAsync(apiUrl);
httpResponse.EnsureSuccessStatusCode();
return await httpResponse.Content.ReadAsStringAsync();
}
}
}

RESPONSE

{
"data": {},
"errors": {},
"meta": {
"code": 200,
"reason": "OK",
"message": "The request was successful",
"request_id": "cdd40f5c-9d82-44c2-92e3-b5d2cad364f6"
}
}

This endpoint allows you to delete an API key for an organisation

HTTP Method

DELETE

HTTP Endpoint

PRODhttps://api.felloh.com/token/key/<KEY_ID>

SANDBOXhttps://sandbox.felloh.com/token/key/<KEY_ID>

Path parameter

ParameterRequiredTypeDescription
key_idtruestringThe key ID that you wish to delete