curl --request POST \
--url https://sandbox.hurdlr.com/rest/v5/accountant/account \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: */*' \
--data '
{
"userId": "fake_userId",
"client_id": "fake_client_id",
"client_secret": "fake_client_secret",
"email": "jane@mycompany.com",
"firstName": "Jane",
"lastName": "Doe",
"canReopenBooks": true,
"canManageAdmins": true,
"canManageUsers": true,
"canAccessAllUsers": true,
"password": "password123"
}
'import requests
url = "https://sandbox.hurdlr.com/rest/v5/accountant/account"
payload = {
"userId": "fake_userId",
"client_id": "fake_client_id",
"client_secret": "fake_client_secret",
"email": "jane@mycompany.com",
"firstName": "Jane",
"lastName": "Doe",
"canReopenBooks": True,
"canManageAdmins": True,
"canManageUsers": True,
"canAccessAllUsers": True,
"password": "password123"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "*/*"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': '*/*'},
body: JSON.stringify({
userId: 'fake_userId',
client_id: 'fake_client_id',
client_secret: 'fake_client_secret',
email: 'jane@mycompany.com',
firstName: 'Jane',
lastName: 'Doe',
canReopenBooks: true,
canManageAdmins: true,
canManageUsers: true,
canAccessAllUsers: true,
password: 'password123'
})
};
fetch('https://sandbox.hurdlr.com/rest/v5/accountant/account', 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://sandbox.hurdlr.com/rest/v5/accountant/account",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'userId' => 'fake_userId',
'client_id' => 'fake_client_id',
'client_secret' => 'fake_client_secret',
'email' => 'jane@mycompany.com',
'firstName' => 'Jane',
'lastName' => 'Doe',
'canReopenBooks' => true,
'canManageAdmins' => true,
'canManageUsers' => true,
'canAccessAllUsers' => true,
'password' => 'password123'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: */*"
],
]);
$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://sandbox.hurdlr.com/rest/v5/accountant/account"
payload := strings.NewReader("{\n \"userId\": \"fake_userId\",\n \"client_id\": \"fake_client_id\",\n \"client_secret\": \"fake_client_secret\",\n \"email\": \"jane@mycompany.com\",\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"canReopenBooks\": true,\n \"canManageAdmins\": true,\n \"canManageUsers\": true,\n \"canAccessAllUsers\": true,\n \"password\": \"password123\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "*/*")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox.hurdlr.com/rest/v5/accountant/account")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "*/*")
.body("{\n \"userId\": \"fake_userId\",\n \"client_id\": \"fake_client_id\",\n \"client_secret\": \"fake_client_secret\",\n \"email\": \"jane@mycompany.com\",\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"canReopenBooks\": true,\n \"canManageAdmins\": true,\n \"canManageUsers\": true,\n \"canAccessAllUsers\": true,\n \"password\": \"password123\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.hurdlr.com/rest/v5/accountant/account")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = '*/*'
request.body = "{\n \"userId\": \"fake_userId\",\n \"client_id\": \"fake_client_id\",\n \"client_secret\": \"fake_client_secret\",\n \"email\": \"jane@mycompany.com\",\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"canReopenBooks\": true,\n \"canManageAdmins\": true,\n \"canManageUsers\": true,\n \"canAccessAllUsers\": true,\n \"password\": \"password123\"\n}"
response = http.request(request)
puts response.read_body{
"result": "SUCCESS",
"oAuth": {
"access_token": "00f6b2b68eb9459eab681d19aa86c6154e225068f3074d1d9b639316d5380a4c.91d620872c3b438ba33f4baaca124624",
"refresh_token": "7369c0ee82194721ac6f633ec16206f348680736e80e4aacb85d4fbce0ee9669.56b43c61141541dc858dd8613959389a",
"expires_in": 7776000,
"created_at": 1599065168,
"scope": "token"
},
"error": {}
}Create an accountant
Create a Tight account for an accountant; the response contains an OAuth 2.0 access token, which can can be used to GET/POST directly into the accountant’s new account
curl --request POST \
--url https://sandbox.hurdlr.com/rest/v5/accountant/account \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: */*' \
--data '
{
"userId": "fake_userId",
"client_id": "fake_client_id",
"client_secret": "fake_client_secret",
"email": "jane@mycompany.com",
"firstName": "Jane",
"lastName": "Doe",
"canReopenBooks": true,
"canManageAdmins": true,
"canManageUsers": true,
"canAccessAllUsers": true,
"password": "password123"
}
'import requests
url = "https://sandbox.hurdlr.com/rest/v5/accountant/account"
payload = {
"userId": "fake_userId",
"client_id": "fake_client_id",
"client_secret": "fake_client_secret",
"email": "jane@mycompany.com",
"firstName": "Jane",
"lastName": "Doe",
"canReopenBooks": True,
"canManageAdmins": True,
"canManageUsers": True,
"canAccessAllUsers": True,
"password": "password123"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "*/*"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': '*/*'},
body: JSON.stringify({
userId: 'fake_userId',
client_id: 'fake_client_id',
client_secret: 'fake_client_secret',
email: 'jane@mycompany.com',
firstName: 'Jane',
lastName: 'Doe',
canReopenBooks: true,
canManageAdmins: true,
canManageUsers: true,
canAccessAllUsers: true,
password: 'password123'
})
};
fetch('https://sandbox.hurdlr.com/rest/v5/accountant/account', 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://sandbox.hurdlr.com/rest/v5/accountant/account",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'userId' => 'fake_userId',
'client_id' => 'fake_client_id',
'client_secret' => 'fake_client_secret',
'email' => 'jane@mycompany.com',
'firstName' => 'Jane',
'lastName' => 'Doe',
'canReopenBooks' => true,
'canManageAdmins' => true,
'canManageUsers' => true,
'canAccessAllUsers' => true,
'password' => 'password123'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: */*"
],
]);
$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://sandbox.hurdlr.com/rest/v5/accountant/account"
payload := strings.NewReader("{\n \"userId\": \"fake_userId\",\n \"client_id\": \"fake_client_id\",\n \"client_secret\": \"fake_client_secret\",\n \"email\": \"jane@mycompany.com\",\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"canReopenBooks\": true,\n \"canManageAdmins\": true,\n \"canManageUsers\": true,\n \"canAccessAllUsers\": true,\n \"password\": \"password123\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "*/*")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://sandbox.hurdlr.com/rest/v5/accountant/account")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "*/*")
.body("{\n \"userId\": \"fake_userId\",\n \"client_id\": \"fake_client_id\",\n \"client_secret\": \"fake_client_secret\",\n \"email\": \"jane@mycompany.com\",\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"canReopenBooks\": true,\n \"canManageAdmins\": true,\n \"canManageUsers\": true,\n \"canAccessAllUsers\": true,\n \"password\": \"password123\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.hurdlr.com/rest/v5/accountant/account")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = '*/*'
request.body = "{\n \"userId\": \"fake_userId\",\n \"client_id\": \"fake_client_id\",\n \"client_secret\": \"fake_client_secret\",\n \"email\": \"jane@mycompany.com\",\n \"firstName\": \"Jane\",\n \"lastName\": \"Doe\",\n \"canReopenBooks\": true,\n \"canManageAdmins\": true,\n \"canManageUsers\": true,\n \"canAccessAllUsers\": true,\n \"password\": \"password123\"\n}"
response = http.request(request)
puts response.read_body{
"result": "SUCCESS",
"oAuth": {
"access_token": "00f6b2b68eb9459eab681d19aa86c6154e225068f3074d1d9b639316d5380a4c.91d620872c3b438ba33f4baaca124624",
"refresh_token": "7369c0ee82194721ac6f633ec16206f348680736e80e4aacb85d4fbce0ee9669.56b43c61141541dc858dd8613959389a",
"expires_in": 7776000,
"created_at": 1599065168,
"scope": "token"
},
"error": {}
}Authorizations
The access token received from the authorization server in the OAuth 2.0 flow.
Body
Id of the accountant in your DB
"fake_userId"
The client_id of the Tight Partner
"fake_client_id"
The client_secret of the Tight Partner
"fake_client_secret"
Email address for the accountant
"jane@mycompany.com"
First name for the accountant
"Jane"
Last name for the accountant
"Doe"
Whether this accountant can reopen books
Whether this accountant can manage other accountants
Whether this accountant can manage users
Whether this accountant has access to all users
Password for the accountant account
"password123"
Response
Successful operation