This object represents an account in Absurdia. The endpoints let you retrieve only your account data and update some attributes.
Related doc: Accounts, Agents and Users
GET /v1/accounts PATCH /v1/accounts
An account object returned by Absurdia's APIs will contain the following attributes:
string
The ID of the account.
boolean
Whether the account is active or not. This will almost always be true.
string
One of individual, pro and business.
string
A name for your account that is easier to communicate than an ID.
string
A description for your account that other users can eventually see. The number of characters is set to maximum 512.
string | null
The legal name of the company owning the account. null if not applicable to the account.
string | null
A number for the company or organisation owning the account. null if not applicable to the account.
This number might be the same as the VAT number for some European countries. In the UK, this number would be Companies House's registration number.
string | null
A VAT number for the company or organisation owning the account. null if not applicable to the account.
object
An Address object for the account. Addresses are used to tailor services & infrastructure to your account. At least a country must be provided. See the Address object for more information on its fields.
object | null
An Address object to put on the bills Absurdia creates for the account. See the Address object for more information on its fields.
string | null
A URL to a website for your account. Must be a valid parsed URL.
string | null
A URL to a logo for your account. Must be a valid parsed URL.
integer
UNIX timestamp in microseconds of the last update on this object.
integer
UNIX timestamp in microseconds of the creation date of this object.
{
"id":"3b0601843083434da2a3cbece4278852",
"account_name": "absurdia",
"account_type": "business",
"active": true,
"address": {
// ... Address object ...
},
"billing_address": null,
"company_name": "Absurdia Ltd",
"company_number": null,
"description":"",
"logo_url":null,
"vat_number":null,
"website_url":null,
"created_at": 1656013730610012,
"updated_at": 1656013730610012,
}
Address objects are always embedded into another object, such as the account object. It carries the following attributes:
string
An alpha-2 country code. It is always 2-characters long.
string | null
The name of a city.
string | null
First line, for the street.
string | null
Second line, for the building/apartment/etc.
string | null
A postal code.
{
"country": "GB",
"city": "London",
"line1": "71-75 Shelton Street",
"line2": null,
"postal_code": "WC2H 9JQ",
"state": null,
}
To get the account data of the authenticated agent, you can just hit the endpoint with no body.
A dictionary with a data attribute that contains the account object for the agent that was authenticated in the request.
GET /v1/accountscurl https://api.absurdia.markets/v1/accounts
-H "Accept: application/json"
-H "Authorization: Bearer {{token}}"
import requests
url = "https://api.absurdia.markets/v1/accounts"
headers = {"Authorization": "Bearer {{token}}"}
response = requests.request("GET", url, headers=headers)
print(response.json())
const fetch = require('node-fetch');
let url = 'https://api.absurdia.markets/v1/accounts';
let options = {method: 'GET', headers: {Authorization: 'Bearer {{token}}'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("https://api.absurdia.markets/v1/accounts"),
Headers =
{
{ "Authorization", "Bearer {{token}}" },
},
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
signature required
Only agents with admin rights can edit an account.
requiredstring
The ID of the account. It can only be your current account.
optionalstring
A description for your account that other users can eventually see. The number of characters is set to maximum 512.
optionalstring
A URL to a website for your account. Must be a valid parsed URL.
A dictionary with a data attribute that contains the updated account data.
PATCH /v1/accountscurl -X PATCH https://api.absurdia.markets/v1/accounts
-H "Accept: application/json"
-H "Content-Type: application/json"
-H "Authorization: Bearer {{token}}"
-d '{"id":"1231231123123","description":"New account description"}'
import requests
url = "https://api.absurdia.markets/v1/accounts"
payload = {
"id": "1231231123123",
"description": "New account description"
}
headers = {
"Authorization": "Bearer {{token}}"
}
response = requests.request("PATCH", url, json=payload, headers=headers)
print(response.json())
const fetch = require('node-fetch');
let url = 'https://api.absurdia.markets/v1/accounts';
let options = {
method: 'PATCH',
headers: {Authorization: 'Bearer {{token}}'},
body: '{"id":"1231231123123","description":"New account description"}'
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("https://api.absurdia.markets/v1/accounts"),
Headers =
{
{ "Authorization", "Bearer {{token}}" },
},
Content = new StringContent("{
"id": "1231231123123",
"description": "New account description"
}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}