curl -X POST \
'https://www.beehexa.com/_mock/api/microsoft-dynamics-365-business-central-api/default-built-by-microsoft/companies(e942a270-62d2-4aef-aa48-6fe3ef9e53e1)/dimensionLines' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"parentId": "2a2dfc50-f21b-4ab0-8f89-463efd0dfce4",
"id": "2a2dfc50-f21b-4ab0-8f89-463efd0dfce4",
"code": null,
"displayName": null,
"valueId": null,
"valuecode": null,
"valuedisplayName": null
}'
const url = 'https://www.beehexa.com/_mock/api/microsoft-dynamics-365-business-central-api/default-built-by-microsoft/companies(e942a270-62d2-4aef-aa48-6fe3ef9e53e1)/dimensionLines';
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json', Authorization: 'Bearer <YOUR_TOKEN_HERE>'},
body: '{"parentId":"2a2dfc50-f21b-4ab0-8f89-463efd0dfce4","id":"2a2dfc50-f21b-4ab0-8f89-463efd0dfce4","code":null,"displayName":null,"valueId":null,"valuecode":null,"valuedisplayName":null}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = 'https://www.beehexa.com/_mock/api/microsoft-dynamics-365-business-central-api/default-built-by-microsoft/companies(e942a270-62d2-4aef-aa48-6fe3ef9e53e1)/dimensionLines';
const options = {
method: 'POST',
headers: {'Content-Type': 'application/json', Authorization: 'Bearer <YOUR_TOKEN_HERE>'},
body: '{"parentId":"2a2dfc50-f21b-4ab0-8f89-463efd0dfce4","id":"2a2dfc50-f21b-4ab0-8f89-463efd0dfce4","code":null,"displayName":null,"valueId":null,"valuecode":null,"valuedisplayName":null}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
import requests
url = "https://www.beehexa.com/_mock/api/microsoft-dynamics-365-business-central-api/default-built-by-microsoft/companies(e942a270-62d2-4aef-aa48-6fe3ef9e53e1)/dimensionLines"
payload = {
"parentId": "2a2dfc50-f21b-4ab0-8f89-463efd0dfce4",
"id": "2a2dfc50-f21b-4ab0-8f89-463efd0dfce4",
"code": None,
"displayName": None,
"valueId": None,
"valuecode": None,
"valuedisplayName": None
}
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer <YOUR_TOKEN_HERE>"
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"parentId\": \"2a2dfc50-f21b-4ab0-8f89-463efd0dfce4\",\n \"id\": \"2a2dfc50-f21b-4ab0-8f89-463efd0dfce4\",\n \"code\": null,\n \"displayName\": null,\n \"valueId\": null,\n \"valuecode\": null,\n \"valuedisplayName\": null\n}");
Request request = new Request.Builder()
.url("https://www.beehexa.com/_mock/api/microsoft-dynamics-365-business-central-api/default-built-by-microsoft/companies(e942a270-62d2-4aef-aa48-6fe3ef9e53e1)/dimensionLines")
.post(body)
.addHeader("Content-Type", "application/json")
.addHeader("Authorization", "Bearer <YOUR_TOKEN_HERE>")
.build();
Response response = client.newCall(request).execute();
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("https://www.beehexa.com/_mock/api/microsoft-dynamics-365-business-central-api/default-built-by-microsoft/companies(e942a270-62d2-4aef-aa48-6fe3ef9e53e1)/dimensionLines"),
Headers =
{
{ "Authorization", "Bearer <YOUR_TOKEN_HERE>" },
},
Content = new StringContent("{\n \"parentId\": \"2a2dfc50-f21b-4ab0-8f89-463efd0dfce4\",\n \"id\": \"2a2dfc50-f21b-4ab0-8f89-463efd0dfce4\",\n \"code\": null,\n \"displayName\": null,\n \"valueId\": null,\n \"valuecode\": null,\n \"valuedisplayName\": null\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);
}
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.beehexa.com/_mock/api/microsoft-dynamics-365-business-central-api/default-built-by-microsoft/companies(e942a270-62d2-4aef-aa48-6fe3ef9e53e1)/dimensionLines",
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([
'parentId' => '2a2dfc50-f21b-4ab0-8f89-463efd0dfce4',
'id' => '2a2dfc50-f21b-4ab0-8f89-463efd0dfce4',
'code' => null,
'displayName' => null,
'valueId' => null,
'valuecode' => null,
'valuedisplayName' => null
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <YOUR_TOKEN_HERE>",
"Content-Type: application/json"
],
]);
$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://www.beehexa.com/_mock/api/microsoft-dynamics-365-business-central-api/default-built-by-microsoft/companies(e942a270-62d2-4aef-aa48-6fe3ef9e53e1)/dimensionLines"
payload := strings.NewReader("{\n \"parentId\": \"2a2dfc50-f21b-4ab0-8f89-463efd0dfce4\",\n \"id\": \"2a2dfc50-f21b-4ab0-8f89-463efd0dfce4\",\n \"code\": null,\n \"displayName\": null,\n \"valueId\": null,\n \"valuecode\": null,\n \"valuedisplayName\": null\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", "Bearer <YOUR_TOKEN_HERE>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}