Xero Assets API
GET
Retrieves fixed asset by id
{{baseUrl}}/Assets/:id
QUERY PARAMS
id
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/Assets/:id");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/Assets/:id")
require "http/client"
url = "{{baseUrl}}/Assets/:id"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/Assets/:id"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/Assets/:id");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/Assets/:id"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/Assets/:id HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/Assets/:id")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/Assets/:id"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/Assets/:id")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/Assets/:id")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/Assets/:id');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/Assets/:id'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/Assets/:id';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/Assets/:id',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/Assets/:id")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/Assets/:id',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/Assets/:id'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/Assets/:id');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/Assets/:id'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/Assets/:id';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/Assets/:id"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/Assets/:id" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/Assets/:id",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/Assets/:id');
echo $response->getBody();
setUrl('{{baseUrl}}/Assets/:id');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/Assets/:id');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/Assets/:id' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/Assets/:id' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/Assets/:id")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/Assets/:id"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/Assets/:id"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/Assets/:id")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/Assets/:id') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/Assets/:id";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/Assets/:id
http GET {{baseUrl}}/Assets/:id
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/Assets/:id
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/Assets/:id")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{ "assetId":"68f17094-af97-4f1b-b36b-013b45b6ad3c", "assetName":"Computer47822", "assetNumber":"123478074", "purchaseDate":"2020-01-01T00:00:00", "purchasePrice":100.0000, "disposalPrice":23.0000, "assetStatus":"Draft", "trackingItems":[
], "bookDepreciationSetting":{ "depreciableObjectId":"68f17094-af97-4f1b-b36b-013b45b6ad3c", "depreciableObjectType":"Asset", "bookEffectiveDateOfChangeId":"5da77739-7f22-4109-b0a0-67480fb89af0", "depreciationMethod":"StraightLine", "averagingMethod":"ActualDays", "depreciationRate":0.50, "depreciationCalculationMethod":"None" }, "bookDepreciationDetail":{ "depreciationStartDate":"2020-01-02T00:00:00", "priorAccumDepreciationAmount":0.000000, "currentAccumDepreciationAmount":0.000000, "currentCapitalGain":0.000000, "currentGainLoss":0.000000 }, "taxDepreciationSettings":[ ], "taxDepreciationDetails":[ ], "canRollback":true, "metaData":{ "bookDepreciationDetailsCanChange":true, "taxDepreciationDetailsCanChange":true }, "accountingBookValue":77.000000, "taxValues":[ ], "isDeleteEnabledForDate":true }
POST
adds a fixed asset type
{{baseUrl}}/AssetTypes
BODY json
{
"accumulatedDepreciationAccountId": "",
"assetTypeId": "",
"assetTypeName": "",
"bookDepreciationSetting": "",
"depreciationExpenseAccountId": "",
"fixedAssetAccountId": "",
"locks": 0
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/AssetTypes");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"accumulatedDepreciationAccountId\": \"\",\n \"assetTypeId\": \"\",\n \"assetTypeName\": \"\",\n \"bookDepreciationSetting\": \"\",\n \"depreciationExpenseAccountId\": \"\",\n \"fixedAssetAccountId\": \"\",\n \"locks\": 0\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/AssetTypes" {:content-type :json
:form-params {:accumulatedDepreciationAccountId ""
:assetTypeId ""
:assetTypeName ""
:bookDepreciationSetting ""
:depreciationExpenseAccountId ""
:fixedAssetAccountId ""
:locks 0}})
require "http/client"
url = "{{baseUrl}}/AssetTypes"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"accumulatedDepreciationAccountId\": \"\",\n \"assetTypeId\": \"\",\n \"assetTypeName\": \"\",\n \"bookDepreciationSetting\": \"\",\n \"depreciationExpenseAccountId\": \"\",\n \"fixedAssetAccountId\": \"\",\n \"locks\": 0\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/AssetTypes"),
Content = new StringContent("{\n \"accumulatedDepreciationAccountId\": \"\",\n \"assetTypeId\": \"\",\n \"assetTypeName\": \"\",\n \"bookDepreciationSetting\": \"\",\n \"depreciationExpenseAccountId\": \"\",\n \"fixedAssetAccountId\": \"\",\n \"locks\": 0\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/AssetTypes");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"accumulatedDepreciationAccountId\": \"\",\n \"assetTypeId\": \"\",\n \"assetTypeName\": \"\",\n \"bookDepreciationSetting\": \"\",\n \"depreciationExpenseAccountId\": \"\",\n \"fixedAssetAccountId\": \"\",\n \"locks\": 0\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/AssetTypes"
payload := strings.NewReader("{\n \"accumulatedDepreciationAccountId\": \"\",\n \"assetTypeId\": \"\",\n \"assetTypeName\": \"\",\n \"bookDepreciationSetting\": \"\",\n \"depreciationExpenseAccountId\": \"\",\n \"fixedAssetAccountId\": \"\",\n \"locks\": 0\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/AssetTypes HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 202
{
"accumulatedDepreciationAccountId": "",
"assetTypeId": "",
"assetTypeName": "",
"bookDepreciationSetting": "",
"depreciationExpenseAccountId": "",
"fixedAssetAccountId": "",
"locks": 0
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/AssetTypes")
.setHeader("content-type", "application/json")
.setBody("{\n \"accumulatedDepreciationAccountId\": \"\",\n \"assetTypeId\": \"\",\n \"assetTypeName\": \"\",\n \"bookDepreciationSetting\": \"\",\n \"depreciationExpenseAccountId\": \"\",\n \"fixedAssetAccountId\": \"\",\n \"locks\": 0\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/AssetTypes"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"accumulatedDepreciationAccountId\": \"\",\n \"assetTypeId\": \"\",\n \"assetTypeName\": \"\",\n \"bookDepreciationSetting\": \"\",\n \"depreciationExpenseAccountId\": \"\",\n \"fixedAssetAccountId\": \"\",\n \"locks\": 0\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"accumulatedDepreciationAccountId\": \"\",\n \"assetTypeId\": \"\",\n \"assetTypeName\": \"\",\n \"bookDepreciationSetting\": \"\",\n \"depreciationExpenseAccountId\": \"\",\n \"fixedAssetAccountId\": \"\",\n \"locks\": 0\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/AssetTypes")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/AssetTypes")
.header("content-type", "application/json")
.body("{\n \"accumulatedDepreciationAccountId\": \"\",\n \"assetTypeId\": \"\",\n \"assetTypeName\": \"\",\n \"bookDepreciationSetting\": \"\",\n \"depreciationExpenseAccountId\": \"\",\n \"fixedAssetAccountId\": \"\",\n \"locks\": 0\n}")
.asString();
const data = JSON.stringify({
accumulatedDepreciationAccountId: '',
assetTypeId: '',
assetTypeName: '',
bookDepreciationSetting: '',
depreciationExpenseAccountId: '',
fixedAssetAccountId: '',
locks: 0
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/AssetTypes');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/AssetTypes',
headers: {'content-type': 'application/json'},
data: {
accumulatedDepreciationAccountId: '',
assetTypeId: '',
assetTypeName: '',
bookDepreciationSetting: '',
depreciationExpenseAccountId: '',
fixedAssetAccountId: '',
locks: 0
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/AssetTypes';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"accumulatedDepreciationAccountId":"","assetTypeId":"","assetTypeName":"","bookDepreciationSetting":"","depreciationExpenseAccountId":"","fixedAssetAccountId":"","locks":0}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/AssetTypes',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "accumulatedDepreciationAccountId": "",\n "assetTypeId": "",\n "assetTypeName": "",\n "bookDepreciationSetting": "",\n "depreciationExpenseAccountId": "",\n "fixedAssetAccountId": "",\n "locks": 0\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"accumulatedDepreciationAccountId\": \"\",\n \"assetTypeId\": \"\",\n \"assetTypeName\": \"\",\n \"bookDepreciationSetting\": \"\",\n \"depreciationExpenseAccountId\": \"\",\n \"fixedAssetAccountId\": \"\",\n \"locks\": 0\n}")
val request = Request.Builder()
.url("{{baseUrl}}/AssetTypes")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/AssetTypes',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
accumulatedDepreciationAccountId: '',
assetTypeId: '',
assetTypeName: '',
bookDepreciationSetting: '',
depreciationExpenseAccountId: '',
fixedAssetAccountId: '',
locks: 0
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/AssetTypes',
headers: {'content-type': 'application/json'},
body: {
accumulatedDepreciationAccountId: '',
assetTypeId: '',
assetTypeName: '',
bookDepreciationSetting: '',
depreciationExpenseAccountId: '',
fixedAssetAccountId: '',
locks: 0
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/AssetTypes');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
accumulatedDepreciationAccountId: '',
assetTypeId: '',
assetTypeName: '',
bookDepreciationSetting: '',
depreciationExpenseAccountId: '',
fixedAssetAccountId: '',
locks: 0
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/AssetTypes',
headers: {'content-type': 'application/json'},
data: {
accumulatedDepreciationAccountId: '',
assetTypeId: '',
assetTypeName: '',
bookDepreciationSetting: '',
depreciationExpenseAccountId: '',
fixedAssetAccountId: '',
locks: 0
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/AssetTypes';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"accumulatedDepreciationAccountId":"","assetTypeId":"","assetTypeName":"","bookDepreciationSetting":"","depreciationExpenseAccountId":"","fixedAssetAccountId":"","locks":0}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"accumulatedDepreciationAccountId": @"",
@"assetTypeId": @"",
@"assetTypeName": @"",
@"bookDepreciationSetting": @"",
@"depreciationExpenseAccountId": @"",
@"fixedAssetAccountId": @"",
@"locks": @0 };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/AssetTypes"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/AssetTypes" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"accumulatedDepreciationAccountId\": \"\",\n \"assetTypeId\": \"\",\n \"assetTypeName\": \"\",\n \"bookDepreciationSetting\": \"\",\n \"depreciationExpenseAccountId\": \"\",\n \"fixedAssetAccountId\": \"\",\n \"locks\": 0\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/AssetTypes",
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([
'accumulatedDepreciationAccountId' => '',
'assetTypeId' => '',
'assetTypeName' => '',
'bookDepreciationSetting' => '',
'depreciationExpenseAccountId' => '',
'fixedAssetAccountId' => '',
'locks' => 0
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/AssetTypes', [
'body' => '{
"accumulatedDepreciationAccountId": "",
"assetTypeId": "",
"assetTypeName": "",
"bookDepreciationSetting": "",
"depreciationExpenseAccountId": "",
"fixedAssetAccountId": "",
"locks": 0
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/AssetTypes');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'accumulatedDepreciationAccountId' => '',
'assetTypeId' => '',
'assetTypeName' => '',
'bookDepreciationSetting' => '',
'depreciationExpenseAccountId' => '',
'fixedAssetAccountId' => '',
'locks' => 0
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'accumulatedDepreciationAccountId' => '',
'assetTypeId' => '',
'assetTypeName' => '',
'bookDepreciationSetting' => '',
'depreciationExpenseAccountId' => '',
'fixedAssetAccountId' => '',
'locks' => 0
]));
$request->setRequestUrl('{{baseUrl}}/AssetTypes');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/AssetTypes' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"accumulatedDepreciationAccountId": "",
"assetTypeId": "",
"assetTypeName": "",
"bookDepreciationSetting": "",
"depreciationExpenseAccountId": "",
"fixedAssetAccountId": "",
"locks": 0
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/AssetTypes' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"accumulatedDepreciationAccountId": "",
"assetTypeId": "",
"assetTypeName": "",
"bookDepreciationSetting": "",
"depreciationExpenseAccountId": "",
"fixedAssetAccountId": "",
"locks": 0
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"accumulatedDepreciationAccountId\": \"\",\n \"assetTypeId\": \"\",\n \"assetTypeName\": \"\",\n \"bookDepreciationSetting\": \"\",\n \"depreciationExpenseAccountId\": \"\",\n \"fixedAssetAccountId\": \"\",\n \"locks\": 0\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/AssetTypes", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/AssetTypes"
payload = {
"accumulatedDepreciationAccountId": "",
"assetTypeId": "",
"assetTypeName": "",
"bookDepreciationSetting": "",
"depreciationExpenseAccountId": "",
"fixedAssetAccountId": "",
"locks": 0
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/AssetTypes"
payload <- "{\n \"accumulatedDepreciationAccountId\": \"\",\n \"assetTypeId\": \"\",\n \"assetTypeName\": \"\",\n \"bookDepreciationSetting\": \"\",\n \"depreciationExpenseAccountId\": \"\",\n \"fixedAssetAccountId\": \"\",\n \"locks\": 0\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/AssetTypes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"accumulatedDepreciationAccountId\": \"\",\n \"assetTypeId\": \"\",\n \"assetTypeName\": \"\",\n \"bookDepreciationSetting\": \"\",\n \"depreciationExpenseAccountId\": \"\",\n \"fixedAssetAccountId\": \"\",\n \"locks\": 0\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/AssetTypes') do |req|
req.body = "{\n \"accumulatedDepreciationAccountId\": \"\",\n \"assetTypeId\": \"\",\n \"assetTypeName\": \"\",\n \"bookDepreciationSetting\": \"\",\n \"depreciationExpenseAccountId\": \"\",\n \"fixedAssetAccountId\": \"\",\n \"locks\": 0\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/AssetTypes";
let payload = json!({
"accumulatedDepreciationAccountId": "",
"assetTypeId": "",
"assetTypeName": "",
"bookDepreciationSetting": "",
"depreciationExpenseAccountId": "",
"fixedAssetAccountId": "",
"locks": 0
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/AssetTypes \
--header 'content-type: application/json' \
--data '{
"accumulatedDepreciationAccountId": "",
"assetTypeId": "",
"assetTypeName": "",
"bookDepreciationSetting": "",
"depreciationExpenseAccountId": "",
"fixedAssetAccountId": "",
"locks": 0
}'
echo '{
"accumulatedDepreciationAccountId": "",
"assetTypeId": "",
"assetTypeName": "",
"bookDepreciationSetting": "",
"depreciationExpenseAccountId": "",
"fixedAssetAccountId": "",
"locks": 0
}' | \
http POST {{baseUrl}}/AssetTypes \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "accumulatedDepreciationAccountId": "",\n "assetTypeId": "",\n "assetTypeName": "",\n "bookDepreciationSetting": "",\n "depreciationExpenseAccountId": "",\n "fixedAssetAccountId": "",\n "locks": 0\n}' \
--output-document \
- {{baseUrl}}/AssetTypes
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"accumulatedDepreciationAccountId": "",
"assetTypeId": "",
"assetTypeName": "",
"bookDepreciationSetting": "",
"depreciationExpenseAccountId": "",
"fixedAssetAccountId": "",
"locks": 0
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/AssetTypes")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{ "assetTypeId":"85509b5d-308e-420d-9532-b85105058916", "assetTypeName":"Machinery11004", "fixedAssetAccountId":"3d8d063a-c148-4bb8-8b3c-a5e2ad3b1e82", "depreciationExpenseAccountId":"d1602f69-f900-4616-8d34-90af393fa368", "accumulatedDepreciationAccountId":"9195cadd-8645-41e6-9f67-7bcd421defe8", "bookDepreciationSetting":{ "depreciableObjectId":"00000000-0000-0000-0000-000000000000", "depreciableObjectType":"None", "depreciationMethod":"DiminishingValue100", "averagingMethod":"ActualDays", "depreciationRate":0.05, "depreciationCalculationMethod":"None" }, "locks":0, "lockPrivateUseAccount":false }
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{ "resourceValidationErrors":[ ], "fieldValidationErrors":[ { "fieldName":"FixedAssetAccountId", "valueProvided":"", "localisedMessage":"Fixed Asset Account Id is invalid", "type":"http://common.service.xero.com/errors/validation/field", "title":"Validation Error", "detail":"Fixed Asset Account Id is invalid" }, { "fieldName":"DepreciationExpenseAccountId", "valueProvided":"", "localisedMessage":"Depreciation Expense Account Id is invalid", "type":"http://common.service.xero.com/errors/validation/field", "title":"Validation Error", "detail":"Depreciation Expense Account Id is invalid" } ], "type":"http://common.service.xero.com/errors/validation", "title":"The resource update failed validation.", "detail":"Validation Errors" }
POST
adds a fixed asset
{{baseUrl}}/Assets
BODY json
{
"accountingBookValue": "",
"assetId": "",
"assetName": "",
"assetNumber": "",
"assetStatus": "",
"assetTypeId": "",
"bookDepreciationDetail": "",
"bookDepreciationSetting": "",
"canRollback": false,
"disposalDate": "",
"disposalPrice": "",
"isDeleteEnabledForDate": false,
"purchaseDate": "",
"purchasePrice": "",
"serialNumber": "",
"warrantyExpiryDate": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/Assets");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"accountingBookValue\": \"\",\n \"assetId\": \"\",\n \"assetName\": \"\",\n \"assetNumber\": \"\",\n \"assetStatus\": \"\",\n \"assetTypeId\": \"\",\n \"bookDepreciationDetail\": \"\",\n \"bookDepreciationSetting\": \"\",\n \"canRollback\": false,\n \"disposalDate\": \"\",\n \"disposalPrice\": \"\",\n \"isDeleteEnabledForDate\": false,\n \"purchaseDate\": \"\",\n \"purchasePrice\": \"\",\n \"serialNumber\": \"\",\n \"warrantyExpiryDate\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/Assets" {:content-type :json
:form-params {:accountingBookValue ""
:assetId ""
:assetName ""
:assetNumber ""
:assetStatus ""
:assetTypeId ""
:bookDepreciationDetail ""
:bookDepreciationSetting ""
:canRollback false
:disposalDate ""
:disposalPrice ""
:isDeleteEnabledForDate false
:purchaseDate ""
:purchasePrice ""
:serialNumber ""
:warrantyExpiryDate ""}})
require "http/client"
url = "{{baseUrl}}/Assets"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"accountingBookValue\": \"\",\n \"assetId\": \"\",\n \"assetName\": \"\",\n \"assetNumber\": \"\",\n \"assetStatus\": \"\",\n \"assetTypeId\": \"\",\n \"bookDepreciationDetail\": \"\",\n \"bookDepreciationSetting\": \"\",\n \"canRollback\": false,\n \"disposalDate\": \"\",\n \"disposalPrice\": \"\",\n \"isDeleteEnabledForDate\": false,\n \"purchaseDate\": \"\",\n \"purchasePrice\": \"\",\n \"serialNumber\": \"\",\n \"warrantyExpiryDate\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/Assets"),
Content = new StringContent("{\n \"accountingBookValue\": \"\",\n \"assetId\": \"\",\n \"assetName\": \"\",\n \"assetNumber\": \"\",\n \"assetStatus\": \"\",\n \"assetTypeId\": \"\",\n \"bookDepreciationDetail\": \"\",\n \"bookDepreciationSetting\": \"\",\n \"canRollback\": false,\n \"disposalDate\": \"\",\n \"disposalPrice\": \"\",\n \"isDeleteEnabledForDate\": false,\n \"purchaseDate\": \"\",\n \"purchasePrice\": \"\",\n \"serialNumber\": \"\",\n \"warrantyExpiryDate\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/Assets");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"accountingBookValue\": \"\",\n \"assetId\": \"\",\n \"assetName\": \"\",\n \"assetNumber\": \"\",\n \"assetStatus\": \"\",\n \"assetTypeId\": \"\",\n \"bookDepreciationDetail\": \"\",\n \"bookDepreciationSetting\": \"\",\n \"canRollback\": false,\n \"disposalDate\": \"\",\n \"disposalPrice\": \"\",\n \"isDeleteEnabledForDate\": false,\n \"purchaseDate\": \"\",\n \"purchasePrice\": \"\",\n \"serialNumber\": \"\",\n \"warrantyExpiryDate\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/Assets"
payload := strings.NewReader("{\n \"accountingBookValue\": \"\",\n \"assetId\": \"\",\n \"assetName\": \"\",\n \"assetNumber\": \"\",\n \"assetStatus\": \"\",\n \"assetTypeId\": \"\",\n \"bookDepreciationDetail\": \"\",\n \"bookDepreciationSetting\": \"\",\n \"canRollback\": false,\n \"disposalDate\": \"\",\n \"disposalPrice\": \"\",\n \"isDeleteEnabledForDate\": false,\n \"purchaseDate\": \"\",\n \"purchasePrice\": \"\",\n \"serialNumber\": \"\",\n \"warrantyExpiryDate\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/Assets HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 394
{
"accountingBookValue": "",
"assetId": "",
"assetName": "",
"assetNumber": "",
"assetStatus": "",
"assetTypeId": "",
"bookDepreciationDetail": "",
"bookDepreciationSetting": "",
"canRollback": false,
"disposalDate": "",
"disposalPrice": "",
"isDeleteEnabledForDate": false,
"purchaseDate": "",
"purchasePrice": "",
"serialNumber": "",
"warrantyExpiryDate": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/Assets")
.setHeader("content-type", "application/json")
.setBody("{\n \"accountingBookValue\": \"\",\n \"assetId\": \"\",\n \"assetName\": \"\",\n \"assetNumber\": \"\",\n \"assetStatus\": \"\",\n \"assetTypeId\": \"\",\n \"bookDepreciationDetail\": \"\",\n \"bookDepreciationSetting\": \"\",\n \"canRollback\": false,\n \"disposalDate\": \"\",\n \"disposalPrice\": \"\",\n \"isDeleteEnabledForDate\": false,\n \"purchaseDate\": \"\",\n \"purchasePrice\": \"\",\n \"serialNumber\": \"\",\n \"warrantyExpiryDate\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/Assets"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"accountingBookValue\": \"\",\n \"assetId\": \"\",\n \"assetName\": \"\",\n \"assetNumber\": \"\",\n \"assetStatus\": \"\",\n \"assetTypeId\": \"\",\n \"bookDepreciationDetail\": \"\",\n \"bookDepreciationSetting\": \"\",\n \"canRollback\": false,\n \"disposalDate\": \"\",\n \"disposalPrice\": \"\",\n \"isDeleteEnabledForDate\": false,\n \"purchaseDate\": \"\",\n \"purchasePrice\": \"\",\n \"serialNumber\": \"\",\n \"warrantyExpiryDate\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"accountingBookValue\": \"\",\n \"assetId\": \"\",\n \"assetName\": \"\",\n \"assetNumber\": \"\",\n \"assetStatus\": \"\",\n \"assetTypeId\": \"\",\n \"bookDepreciationDetail\": \"\",\n \"bookDepreciationSetting\": \"\",\n \"canRollback\": false,\n \"disposalDate\": \"\",\n \"disposalPrice\": \"\",\n \"isDeleteEnabledForDate\": false,\n \"purchaseDate\": \"\",\n \"purchasePrice\": \"\",\n \"serialNumber\": \"\",\n \"warrantyExpiryDate\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/Assets")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/Assets")
.header("content-type", "application/json")
.body("{\n \"accountingBookValue\": \"\",\n \"assetId\": \"\",\n \"assetName\": \"\",\n \"assetNumber\": \"\",\n \"assetStatus\": \"\",\n \"assetTypeId\": \"\",\n \"bookDepreciationDetail\": \"\",\n \"bookDepreciationSetting\": \"\",\n \"canRollback\": false,\n \"disposalDate\": \"\",\n \"disposalPrice\": \"\",\n \"isDeleteEnabledForDate\": false,\n \"purchaseDate\": \"\",\n \"purchasePrice\": \"\",\n \"serialNumber\": \"\",\n \"warrantyExpiryDate\": \"\"\n}")
.asString();
const data = JSON.stringify({
accountingBookValue: '',
assetId: '',
assetName: '',
assetNumber: '',
assetStatus: '',
assetTypeId: '',
bookDepreciationDetail: '',
bookDepreciationSetting: '',
canRollback: false,
disposalDate: '',
disposalPrice: '',
isDeleteEnabledForDate: false,
purchaseDate: '',
purchasePrice: '',
serialNumber: '',
warrantyExpiryDate: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/Assets');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/Assets',
headers: {'content-type': 'application/json'},
data: {
accountingBookValue: '',
assetId: '',
assetName: '',
assetNumber: '',
assetStatus: '',
assetTypeId: '',
bookDepreciationDetail: '',
bookDepreciationSetting: '',
canRollback: false,
disposalDate: '',
disposalPrice: '',
isDeleteEnabledForDate: false,
purchaseDate: '',
purchasePrice: '',
serialNumber: '',
warrantyExpiryDate: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/Assets';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"accountingBookValue":"","assetId":"","assetName":"","assetNumber":"","assetStatus":"","assetTypeId":"","bookDepreciationDetail":"","bookDepreciationSetting":"","canRollback":false,"disposalDate":"","disposalPrice":"","isDeleteEnabledForDate":false,"purchaseDate":"","purchasePrice":"","serialNumber":"","warrantyExpiryDate":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/Assets',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "accountingBookValue": "",\n "assetId": "",\n "assetName": "",\n "assetNumber": "",\n "assetStatus": "",\n "assetTypeId": "",\n "bookDepreciationDetail": "",\n "bookDepreciationSetting": "",\n "canRollback": false,\n "disposalDate": "",\n "disposalPrice": "",\n "isDeleteEnabledForDate": false,\n "purchaseDate": "",\n "purchasePrice": "",\n "serialNumber": "",\n "warrantyExpiryDate": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"accountingBookValue\": \"\",\n \"assetId\": \"\",\n \"assetName\": \"\",\n \"assetNumber\": \"\",\n \"assetStatus\": \"\",\n \"assetTypeId\": \"\",\n \"bookDepreciationDetail\": \"\",\n \"bookDepreciationSetting\": \"\",\n \"canRollback\": false,\n \"disposalDate\": \"\",\n \"disposalPrice\": \"\",\n \"isDeleteEnabledForDate\": false,\n \"purchaseDate\": \"\",\n \"purchasePrice\": \"\",\n \"serialNumber\": \"\",\n \"warrantyExpiryDate\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/Assets")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/Assets',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
accountingBookValue: '',
assetId: '',
assetName: '',
assetNumber: '',
assetStatus: '',
assetTypeId: '',
bookDepreciationDetail: '',
bookDepreciationSetting: '',
canRollback: false,
disposalDate: '',
disposalPrice: '',
isDeleteEnabledForDate: false,
purchaseDate: '',
purchasePrice: '',
serialNumber: '',
warrantyExpiryDate: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/Assets',
headers: {'content-type': 'application/json'},
body: {
accountingBookValue: '',
assetId: '',
assetName: '',
assetNumber: '',
assetStatus: '',
assetTypeId: '',
bookDepreciationDetail: '',
bookDepreciationSetting: '',
canRollback: false,
disposalDate: '',
disposalPrice: '',
isDeleteEnabledForDate: false,
purchaseDate: '',
purchasePrice: '',
serialNumber: '',
warrantyExpiryDate: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/Assets');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
accountingBookValue: '',
assetId: '',
assetName: '',
assetNumber: '',
assetStatus: '',
assetTypeId: '',
bookDepreciationDetail: '',
bookDepreciationSetting: '',
canRollback: false,
disposalDate: '',
disposalPrice: '',
isDeleteEnabledForDate: false,
purchaseDate: '',
purchasePrice: '',
serialNumber: '',
warrantyExpiryDate: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/Assets',
headers: {'content-type': 'application/json'},
data: {
accountingBookValue: '',
assetId: '',
assetName: '',
assetNumber: '',
assetStatus: '',
assetTypeId: '',
bookDepreciationDetail: '',
bookDepreciationSetting: '',
canRollback: false,
disposalDate: '',
disposalPrice: '',
isDeleteEnabledForDate: false,
purchaseDate: '',
purchasePrice: '',
serialNumber: '',
warrantyExpiryDate: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/Assets';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"accountingBookValue":"","assetId":"","assetName":"","assetNumber":"","assetStatus":"","assetTypeId":"","bookDepreciationDetail":"","bookDepreciationSetting":"","canRollback":false,"disposalDate":"","disposalPrice":"","isDeleteEnabledForDate":false,"purchaseDate":"","purchasePrice":"","serialNumber":"","warrantyExpiryDate":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"accountingBookValue": @"",
@"assetId": @"",
@"assetName": @"",
@"assetNumber": @"",
@"assetStatus": @"",
@"assetTypeId": @"",
@"bookDepreciationDetail": @"",
@"bookDepreciationSetting": @"",
@"canRollback": @NO,
@"disposalDate": @"",
@"disposalPrice": @"",
@"isDeleteEnabledForDate": @NO,
@"purchaseDate": @"",
@"purchasePrice": @"",
@"serialNumber": @"",
@"warrantyExpiryDate": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/Assets"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/Assets" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"accountingBookValue\": \"\",\n \"assetId\": \"\",\n \"assetName\": \"\",\n \"assetNumber\": \"\",\n \"assetStatus\": \"\",\n \"assetTypeId\": \"\",\n \"bookDepreciationDetail\": \"\",\n \"bookDepreciationSetting\": \"\",\n \"canRollback\": false,\n \"disposalDate\": \"\",\n \"disposalPrice\": \"\",\n \"isDeleteEnabledForDate\": false,\n \"purchaseDate\": \"\",\n \"purchasePrice\": \"\",\n \"serialNumber\": \"\",\n \"warrantyExpiryDate\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/Assets",
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([
'accountingBookValue' => '',
'assetId' => '',
'assetName' => '',
'assetNumber' => '',
'assetStatus' => '',
'assetTypeId' => '',
'bookDepreciationDetail' => '',
'bookDepreciationSetting' => '',
'canRollback' => null,
'disposalDate' => '',
'disposalPrice' => '',
'isDeleteEnabledForDate' => null,
'purchaseDate' => '',
'purchasePrice' => '',
'serialNumber' => '',
'warrantyExpiryDate' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/Assets', [
'body' => '{
"accountingBookValue": "",
"assetId": "",
"assetName": "",
"assetNumber": "",
"assetStatus": "",
"assetTypeId": "",
"bookDepreciationDetail": "",
"bookDepreciationSetting": "",
"canRollback": false,
"disposalDate": "",
"disposalPrice": "",
"isDeleteEnabledForDate": false,
"purchaseDate": "",
"purchasePrice": "",
"serialNumber": "",
"warrantyExpiryDate": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/Assets');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'accountingBookValue' => '',
'assetId' => '',
'assetName' => '',
'assetNumber' => '',
'assetStatus' => '',
'assetTypeId' => '',
'bookDepreciationDetail' => '',
'bookDepreciationSetting' => '',
'canRollback' => null,
'disposalDate' => '',
'disposalPrice' => '',
'isDeleteEnabledForDate' => null,
'purchaseDate' => '',
'purchasePrice' => '',
'serialNumber' => '',
'warrantyExpiryDate' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'accountingBookValue' => '',
'assetId' => '',
'assetName' => '',
'assetNumber' => '',
'assetStatus' => '',
'assetTypeId' => '',
'bookDepreciationDetail' => '',
'bookDepreciationSetting' => '',
'canRollback' => null,
'disposalDate' => '',
'disposalPrice' => '',
'isDeleteEnabledForDate' => null,
'purchaseDate' => '',
'purchasePrice' => '',
'serialNumber' => '',
'warrantyExpiryDate' => ''
]));
$request->setRequestUrl('{{baseUrl}}/Assets');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/Assets' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"accountingBookValue": "",
"assetId": "",
"assetName": "",
"assetNumber": "",
"assetStatus": "",
"assetTypeId": "",
"bookDepreciationDetail": "",
"bookDepreciationSetting": "",
"canRollback": false,
"disposalDate": "",
"disposalPrice": "",
"isDeleteEnabledForDate": false,
"purchaseDate": "",
"purchasePrice": "",
"serialNumber": "",
"warrantyExpiryDate": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/Assets' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"accountingBookValue": "",
"assetId": "",
"assetName": "",
"assetNumber": "",
"assetStatus": "",
"assetTypeId": "",
"bookDepreciationDetail": "",
"bookDepreciationSetting": "",
"canRollback": false,
"disposalDate": "",
"disposalPrice": "",
"isDeleteEnabledForDate": false,
"purchaseDate": "",
"purchasePrice": "",
"serialNumber": "",
"warrantyExpiryDate": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"accountingBookValue\": \"\",\n \"assetId\": \"\",\n \"assetName\": \"\",\n \"assetNumber\": \"\",\n \"assetStatus\": \"\",\n \"assetTypeId\": \"\",\n \"bookDepreciationDetail\": \"\",\n \"bookDepreciationSetting\": \"\",\n \"canRollback\": false,\n \"disposalDate\": \"\",\n \"disposalPrice\": \"\",\n \"isDeleteEnabledForDate\": false,\n \"purchaseDate\": \"\",\n \"purchasePrice\": \"\",\n \"serialNumber\": \"\",\n \"warrantyExpiryDate\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/Assets", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/Assets"
payload = {
"accountingBookValue": "",
"assetId": "",
"assetName": "",
"assetNumber": "",
"assetStatus": "",
"assetTypeId": "",
"bookDepreciationDetail": "",
"bookDepreciationSetting": "",
"canRollback": False,
"disposalDate": "",
"disposalPrice": "",
"isDeleteEnabledForDate": False,
"purchaseDate": "",
"purchasePrice": "",
"serialNumber": "",
"warrantyExpiryDate": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/Assets"
payload <- "{\n \"accountingBookValue\": \"\",\n \"assetId\": \"\",\n \"assetName\": \"\",\n \"assetNumber\": \"\",\n \"assetStatus\": \"\",\n \"assetTypeId\": \"\",\n \"bookDepreciationDetail\": \"\",\n \"bookDepreciationSetting\": \"\",\n \"canRollback\": false,\n \"disposalDate\": \"\",\n \"disposalPrice\": \"\",\n \"isDeleteEnabledForDate\": false,\n \"purchaseDate\": \"\",\n \"purchasePrice\": \"\",\n \"serialNumber\": \"\",\n \"warrantyExpiryDate\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/Assets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"accountingBookValue\": \"\",\n \"assetId\": \"\",\n \"assetName\": \"\",\n \"assetNumber\": \"\",\n \"assetStatus\": \"\",\n \"assetTypeId\": \"\",\n \"bookDepreciationDetail\": \"\",\n \"bookDepreciationSetting\": \"\",\n \"canRollback\": false,\n \"disposalDate\": \"\",\n \"disposalPrice\": \"\",\n \"isDeleteEnabledForDate\": false,\n \"purchaseDate\": \"\",\n \"purchasePrice\": \"\",\n \"serialNumber\": \"\",\n \"warrantyExpiryDate\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/Assets') do |req|
req.body = "{\n \"accountingBookValue\": \"\",\n \"assetId\": \"\",\n \"assetName\": \"\",\n \"assetNumber\": \"\",\n \"assetStatus\": \"\",\n \"assetTypeId\": \"\",\n \"bookDepreciationDetail\": \"\",\n \"bookDepreciationSetting\": \"\",\n \"canRollback\": false,\n \"disposalDate\": \"\",\n \"disposalPrice\": \"\",\n \"isDeleteEnabledForDate\": false,\n \"purchaseDate\": \"\",\n \"purchasePrice\": \"\",\n \"serialNumber\": \"\",\n \"warrantyExpiryDate\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/Assets";
let payload = json!({
"accountingBookValue": "",
"assetId": "",
"assetName": "",
"assetNumber": "",
"assetStatus": "",
"assetTypeId": "",
"bookDepreciationDetail": "",
"bookDepreciationSetting": "",
"canRollback": false,
"disposalDate": "",
"disposalPrice": "",
"isDeleteEnabledForDate": false,
"purchaseDate": "",
"purchasePrice": "",
"serialNumber": "",
"warrantyExpiryDate": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/Assets \
--header 'content-type: application/json' \
--data '{
"accountingBookValue": "",
"assetId": "",
"assetName": "",
"assetNumber": "",
"assetStatus": "",
"assetTypeId": "",
"bookDepreciationDetail": "",
"bookDepreciationSetting": "",
"canRollback": false,
"disposalDate": "",
"disposalPrice": "",
"isDeleteEnabledForDate": false,
"purchaseDate": "",
"purchasePrice": "",
"serialNumber": "",
"warrantyExpiryDate": ""
}'
echo '{
"accountingBookValue": "",
"assetId": "",
"assetName": "",
"assetNumber": "",
"assetStatus": "",
"assetTypeId": "",
"bookDepreciationDetail": "",
"bookDepreciationSetting": "",
"canRollback": false,
"disposalDate": "",
"disposalPrice": "",
"isDeleteEnabledForDate": false,
"purchaseDate": "",
"purchasePrice": "",
"serialNumber": "",
"warrantyExpiryDate": ""
}' | \
http POST {{baseUrl}}/Assets \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "accountingBookValue": "",\n "assetId": "",\n "assetName": "",\n "assetNumber": "",\n "assetStatus": "",\n "assetTypeId": "",\n "bookDepreciationDetail": "",\n "bookDepreciationSetting": "",\n "canRollback": false,\n "disposalDate": "",\n "disposalPrice": "",\n "isDeleteEnabledForDate": false,\n "purchaseDate": "",\n "purchasePrice": "",\n "serialNumber": "",\n "warrantyExpiryDate": ""\n}' \
--output-document \
- {{baseUrl}}/Assets
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"accountingBookValue": "",
"assetId": "",
"assetName": "",
"assetNumber": "",
"assetStatus": "",
"assetTypeId": "",
"bookDepreciationDetail": "",
"bookDepreciationSetting": "",
"canRollback": false,
"disposalDate": "",
"disposalPrice": "",
"isDeleteEnabledForDate": false,
"purchaseDate": "",
"purchasePrice": "",
"serialNumber": "",
"warrantyExpiryDate": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/Assets")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{ "assetId":"2257c64a-77ca-444c-a5ea-fa9a588c7039", "assetName":"Computer74863", "assetNumber":"123477544", "purchaseDate":"2020-01-01T00:00:00", "purchasePrice":100.0000, "disposalPrice":23.2300, "assetStatus":"Draft", "trackingItems":[], "bookDepreciationSetting":{ "depreciableObjectId":"2257c64a-77ca-444c-a5ea-fa9a588c7039", "depreciableObjectType":"Asset", "bookEffectiveDateOfChangeId":"b58a2ace-1213-4681-9f11-2e30f57b5b8c", "depreciationMethod":"StraightLine", "averagingMethod":"ActualDays", "depreciationRate":0.50, "depreciationCalculationMethod":"None" }, "bookDepreciationDetail":{ "depreciationStartDate":"2020-01-02T00:00:00", "priorAccumDepreciationAmount":0.000000, "currentAccumDepreciationAmount":0.000000, "currentCapitalGain":0.000000, "currentGainLoss":0.000000 }, "taxDepreciationSettings":[ ], "taxDepreciationDetails":[], "canRollback":true, "accountingBookValue":76.770000, "taxValues":[], "isDeleteEnabledForDate":true }
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{ "resourceValidationErrors":[ ], "fieldValidationErrors":[ { "fieldName":"BookDepreciationSetting.DepreciationRate", "valueProvided":"", "localisedMessage":"Can't have both Depreciation Rate and Effective Life", "type":"http://common.service.xero.com/errors/validation/field", "title":"Validation Error", "detail":"Can't have both Depreciation Rate and Effective Life" } ], "type":"http://common.service.xero.com/errors/validation", "title":"The resource update failed validation.", "detail":"Validation Errors" }
GET
searches fixed asset settings
{{baseUrl}}/Settings
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/Settings");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/Settings")
require "http/client"
url = "{{baseUrl}}/Settings"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/Settings"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/Settings");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/Settings"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/Settings HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/Settings")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/Settings"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/Settings")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/Settings")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/Settings');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/Settings'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/Settings';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/Settings',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/Settings")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/Settings',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/Settings'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/Settings');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/Settings'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/Settings';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/Settings"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/Settings" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/Settings",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/Settings');
echo $response->getBody();
setUrl('{{baseUrl}}/Settings');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/Settings');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/Settings' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/Settings' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/Settings")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/Settings"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/Settings"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/Settings")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/Settings') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/Settings";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/Settings
http GET {{baseUrl}}/Settings
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/Settings
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/Settings")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{ "assetNumberPrefix":"FA-", "assetNumberSequence":"0007", "assetStartDate":"2016-01-01T00:00:00", "optInForTax":false }
GET
searches fixed asset types
{{baseUrl}}/AssetTypes
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/AssetTypes");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/AssetTypes")
require "http/client"
url = "{{baseUrl}}/AssetTypes"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/AssetTypes"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/AssetTypes");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/AssetTypes"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/AssetTypes HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/AssetTypes")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/AssetTypes"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/AssetTypes")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/AssetTypes")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/AssetTypes');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/AssetTypes'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/AssetTypes';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/AssetTypes',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/AssetTypes")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/AssetTypes',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/AssetTypes'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/AssetTypes');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/AssetTypes'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/AssetTypes';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/AssetTypes"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/AssetTypes" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/AssetTypes",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/AssetTypes');
echo $response->getBody();
setUrl('{{baseUrl}}/AssetTypes');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/AssetTypes');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/AssetTypes' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/AssetTypes' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/AssetTypes")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/AssetTypes"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/AssetTypes"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/AssetTypes")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/AssetTypes') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/AssetTypes";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/AssetTypes
http GET {{baseUrl}}/AssetTypes
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/AssetTypes
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/AssetTypes")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
[ { "assetTypeId":"710255c6-d2ed-4463-b992-06c8685add5e", "assetTypeName":"Computer Equipment", "fixedAssetAccountId":"37c35de7-8df0-44bf-8e7c-f1f67cf6a278", "depreciationExpenseAccountId":"0fbd1820-9dd0-454a-9515-6ec076a84cf7", "accumulatedDepreciationAccountId":"512eac06-6894-47cd-b421-673b4ca2693a", "bookDepreciationSetting":{ "depreciableObjectId":"710255c6-d2ed-4463-b992-06c8685add5e", "depreciableObjectType":"AssetType", "bookEffectiveDateOfChangeId":"39b9c2e9-62b1-4efc-ab75-fa9152ffaa5f", "depreciationMethod":"StraightLine", "averagingMethod":"FullMonth", "depreciationRate":25.00, "depreciationCalculationMethod":"None" }, "taxDepreciationSettings":[ ], "locks":0, "lockPrivateUseAccount":false }, { "assetTypeId":"1a398a67-9d9d-4783-8689-14a8efce89d9", "assetTypeName":"Machinery97704", "fixedAssetAccountId":"5c93f577-c48f-44cd-8593-01489e319c2b", "depreciationExpenseAccountId":"adc14376-c960-43f0-b7f3-4063e5098039", "accumulatedDepreciationAccountId":"9195cadd-8645-41e6-9f67-7bcd421defe8", "bookDepreciationSetting":{ "depreciableObjectId":"1a398a67-9d9d-4783-8689-14a8efce89d9", "depreciableObjectType":"AssetType", "bookEffectiveDateOfChangeId":"6d09a96d-7768-4f28-95e8-c9ac870fe36e", "depreciationMethod":"DiminishingValue100", "averagingMethod":"ActualDays", "depreciationRate":40.00, "depreciationCalculationMethod":"None" }, "taxDepreciationSettings":[ ], "locks":0, "lockPrivateUseAccount":false } ]
GET
searches fixed asset
{{baseUrl}}/Assets
QUERY PARAMS
status
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/Assets?status=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/Assets" {:query-params {:status ""}})
require "http/client"
url = "{{baseUrl}}/Assets?status="
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/Assets?status="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/Assets?status=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/Assets?status="
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/Assets?status= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/Assets?status=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/Assets?status="))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/Assets?status=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/Assets?status=")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/Assets?status=');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/Assets', params: {status: ''}};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/Assets?status=';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/Assets?status=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/Assets?status=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/Assets?status=',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/Assets', qs: {status: ''}};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/Assets');
req.query({
status: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/Assets', params: {status: ''}};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/Assets?status=';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/Assets?status="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/Assets?status=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/Assets?status=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/Assets?status=');
echo $response->getBody();
setUrl('{{baseUrl}}/Assets');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'status' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/Assets');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'status' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/Assets?status=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/Assets?status=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/Assets?status=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/Assets"
querystring = {"status":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/Assets"
queryString <- list(status = "")
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/Assets?status=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/Assets') do |req|
req.params['status'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/Assets";
let querystring = [
("status", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/Assets?status='
http GET '{{baseUrl}}/Assets?status='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/Assets?status='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/Assets?status=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
RESPONSE HEADERS
Content-Type
application/json
RESPONSE BODY json
{ "pagination":{ "page":1, "pageSize":10, "pageCount":2, "itemCount":11, "links":{ "first":{ "href":"http://asset.favorit.xero.com/v1/assets?status=DRAFT&page=1" }, "next":{ "href":"http://asset.favorit.xero.com/v1/assets?status=DRAFT&page=2" }, "last":{ "href":"http://asset.favorit.xero.com/v1/assets?status=DRAFT&page=2" } } }, "items":[ { "assetId":"68f17094-af97-4f1b-b36b-013b45b6ad3c", "assetName":"Computer47822", "assetNumber":"123478074", "purchaseDate":"2020-01-01T00:00:00", "purchasePrice":100.0000, "disposalPrice":0.0, "assetStatus":"Draft", "trackingItems":[ ], "bookDepreciationSetting":{ "depreciableObjectId":"68f17094-af97-4f1b-b36b-013b45b6ad3c", "depreciableObjectType":"Asset", "bookEffectiveDateOfChangeId":"5da77739-7f22-4109-b0a0-67480fb89af0", "depreciationMethod":"StraightLine", "averagingMethod":"ActualDays", "depreciationRate":0.50, "depreciationCalculationMethod":"None" }, "bookDepreciationDetail":{ "depreciationStartDate":"2020-01-02T00:00:00", "priorAccumDepreciationAmount":0.000000, "currentAccumDepreciationAmount":0.000000, "currentCapitalGain":0.000000, "currentGainLoss":0.000000 }, "taxDepreciationSettings":[ ], "taxDepreciationDetails":[ ], "canRollback":true, "accountingBookValue":100.000000, "taxValues":[ ], "isDeleteEnabledForDate":false }, { "assetId":"52ea3adf-f04a-4577-8fd2-43c52a256bd5", "assetName":"Computer4148", "assetNumber":"123466620", "purchaseDate":"2020-01-01T00:00:00", "purchasePrice":100.0000, "disposalPrice":0.0, "assetStatus":"Draft", "trackingItems":[
], "bookDepreciationSetting":{ "depreciableObjectId":"52ea3adf-f04a-4577-8fd2-43c52a256bd5", "depreciableObjectType":"Asset", "bookEffectiveDateOfChangeId":"c0d5280f-28b6-4329-b5b7-36e08c662010", "depreciationMethod":"StraightLine", "averagingMethod":"ActualDays", "depreciationRate":0.50, "depreciationCalculationMethod":"None" }, "bookDepreciationDetail":{ "depreciationStartDate":"2020-01-02T00:00:00", "priorAccumDepreciationAmount":0.000000, "currentAccumDepreciationAmount":0.000000, "currentCapitalGain":0.000000, "currentGainLoss":0.000000 }, "taxDepreciationSettings":[ ], "taxDepreciationDetails":[ ], "canRollback":true, "accountingBookValue":100.000000, "taxValues":[
], "isDeleteEnabledForDate":false } ] }