Add address
curl --request POST \
--url https://api.atlas.kitchen/accounts/v1/addresses \
--header 'Content-Type: application/json' \
--header 'X-Channel-Id: <api-key>' \
--header 'X-Session-Id: <api-key>' \
--data '
{
"line1": "5 Straits View",
"line2": "#12-01",
"postal_code": "018935",
"notes": "Leave at reception",
"latitude": 1.2789,
"longitude": 103.8536
}
'import requests
url = "https://api.atlas.kitchen/accounts/v1/addresses"
payload = {
"line1": "5 Straits View",
"line2": "#12-01",
"postal_code": "018935",
"notes": "Leave at reception",
"latitude": 1.2789,
"longitude": 103.8536
}
headers = {
"X-Channel-Id": "<api-key>",
"X-Session-Id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Channel-Id': '<api-key>',
'X-Session-Id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
line1: '5 Straits View',
line2: '#12-01',
postal_code: '018935',
notes: 'Leave at reception',
latitude: 1.2789,
longitude: 103.8536
})
};
fetch('https://api.atlas.kitchen/accounts/v1/addresses', 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://api.atlas.kitchen/accounts/v1/addresses",
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([
'line1' => '5 Straits View',
'line2' => '#12-01',
'postal_code' => '018935',
'notes' => 'Leave at reception',
'latitude' => 1.2789,
'longitude' => 103.8536
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Channel-Id: <api-key>",
"X-Session-Id: <api-key>"
],
]);
$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://api.atlas.kitchen/accounts/v1/addresses"
payload := strings.NewReader("{\n \"line1\": \"5 Straits View\",\n \"line2\": \"#12-01\",\n \"postal_code\": \"018935\",\n \"notes\": \"Leave at reception\",\n \"latitude\": 1.2789,\n \"longitude\": 103.8536\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Channel-Id", "<api-key>")
req.Header.Add("X-Session-Id", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.atlas.kitchen/accounts/v1/addresses")
.header("X-Channel-Id", "<api-key>")
.header("X-Session-Id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"line1\": \"5 Straits View\",\n \"line2\": \"#12-01\",\n \"postal_code\": \"018935\",\n \"notes\": \"Leave at reception\",\n \"latitude\": 1.2789,\n \"longitude\": 103.8536\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.atlas.kitchen/accounts/v1/addresses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Channel-Id"] = '<api-key>'
request["X-Session-Id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"line1\": \"5 Straits View\",\n \"line2\": \"#12-01\",\n \"postal_code\": \"018935\",\n \"notes\": \"Leave at reception\",\n \"latitude\": 1.2789,\n \"longitude\": 103.8536\n}"
response = http.request(request)
puts response.read_body{
"id": 3,
"line1": "5 Straits View",
"line2": "#12-01",
"postal_code": "018935",
"notes": "Leave at reception",
"longitude": 103.8536,
"latitude": 1.2789,
"default": true
}{
"type": "Unauthorized",
"message": "You did not provide valid credentials for this request. Please check your request and try again.",
"details": [
{
"field": "login",
"message": "You have to be logged in to process this request."
}
]
}{
"type": "Forbidden",
"message": "You do not have permission to process this request. Please check your credentials or contact support if the issue persists.",
"details": [
{
"field": "mobile_number",
"message": "Your mobile number is not verified. Verify your mobile number first before managing your account."
}
]
}{
"type": "Invalid Parameter",
"message": "Validation failed for one or more fields. Please check your request and try again.",
"details": [
{
"field": "line1",
"message": "can't be blank"
}
]
}Add address
The new address becomes the default.
POST
/
addresses
Add address
curl --request POST \
--url https://api.atlas.kitchen/accounts/v1/addresses \
--header 'Content-Type: application/json' \
--header 'X-Channel-Id: <api-key>' \
--header 'X-Session-Id: <api-key>' \
--data '
{
"line1": "5 Straits View",
"line2": "#12-01",
"postal_code": "018935",
"notes": "Leave at reception",
"latitude": 1.2789,
"longitude": 103.8536
}
'import requests
url = "https://api.atlas.kitchen/accounts/v1/addresses"
payload = {
"line1": "5 Straits View",
"line2": "#12-01",
"postal_code": "018935",
"notes": "Leave at reception",
"latitude": 1.2789,
"longitude": 103.8536
}
headers = {
"X-Channel-Id": "<api-key>",
"X-Session-Id": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'X-Channel-Id': '<api-key>',
'X-Session-Id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
line1: '5 Straits View',
line2: '#12-01',
postal_code: '018935',
notes: 'Leave at reception',
latitude: 1.2789,
longitude: 103.8536
})
};
fetch('https://api.atlas.kitchen/accounts/v1/addresses', 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://api.atlas.kitchen/accounts/v1/addresses",
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([
'line1' => '5 Straits View',
'line2' => '#12-01',
'postal_code' => '018935',
'notes' => 'Leave at reception',
'latitude' => 1.2789,
'longitude' => 103.8536
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-Channel-Id: <api-key>",
"X-Session-Id: <api-key>"
],
]);
$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://api.atlas.kitchen/accounts/v1/addresses"
payload := strings.NewReader("{\n \"line1\": \"5 Straits View\",\n \"line2\": \"#12-01\",\n \"postal_code\": \"018935\",\n \"notes\": \"Leave at reception\",\n \"latitude\": 1.2789,\n \"longitude\": 103.8536\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-Channel-Id", "<api-key>")
req.Header.Add("X-Session-Id", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.atlas.kitchen/accounts/v1/addresses")
.header("X-Channel-Id", "<api-key>")
.header("X-Session-Id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"line1\": \"5 Straits View\",\n \"line2\": \"#12-01\",\n \"postal_code\": \"018935\",\n \"notes\": \"Leave at reception\",\n \"latitude\": 1.2789,\n \"longitude\": 103.8536\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.atlas.kitchen/accounts/v1/addresses")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Channel-Id"] = '<api-key>'
request["X-Session-Id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"line1\": \"5 Straits View\",\n \"line2\": \"#12-01\",\n \"postal_code\": \"018935\",\n \"notes\": \"Leave at reception\",\n \"latitude\": 1.2789,\n \"longitude\": 103.8536\n}"
response = http.request(request)
puts response.read_body{
"id": 3,
"line1": "5 Straits View",
"line2": "#12-01",
"postal_code": "018935",
"notes": "Leave at reception",
"longitude": 103.8536,
"latitude": 1.2789,
"default": true
}{
"type": "Unauthorized",
"message": "You did not provide valid credentials for this request. Please check your request and try again.",
"details": [
{
"field": "login",
"message": "You have to be logged in to process this request."
}
]
}{
"type": "Forbidden",
"message": "You do not have permission to process this request. Please check your credentials or contact support if the issue persists.",
"details": [
{
"field": "mobile_number",
"message": "Your mobile number is not verified. Verify your mobile number first before managing your account."
}
]
}{
"type": "Invalid Parameter",
"message": "Validation failed for one or more fields. Please check your request and try again.",
"details": [
{
"field": "line1",
"message": "can't be blank"
}
]
}Authorizations
Body
application/json
Was this page helpful?