Request login code
curl --request POST \
--url https://api.atlas.kitchen/accounts/v1/request_otp \
--header 'Content-Type: application/json' \
--header 'X-Channel-Id: <api-key>' \
--header 'X-Session-Id: <api-key>' \
--data '
{
"mobile_number": "+6581000001",
"delivery_mode": "whatsapp"
}
'import requests
url = "https://api.atlas.kitchen/accounts/v1/request_otp"
payload = {
"mobile_number": "+6581000001",
"delivery_mode": "whatsapp"
}
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({mobile_number: '+6581000001', delivery_mode: 'whatsapp'})
};
fetch('https://api.atlas.kitchen/accounts/v1/request_otp', 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/request_otp",
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([
'mobile_number' => '+6581000001',
'delivery_mode' => 'whatsapp'
]),
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/request_otp"
payload := strings.NewReader("{\n \"mobile_number\": \"+6581000001\",\n \"delivery_mode\": \"whatsapp\"\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/request_otp")
.header("X-Channel-Id", "<api-key>")
.header("X-Session-Id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"mobile_number\": \"+6581000001\",\n \"delivery_mode\": \"whatsapp\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.atlas.kitchen/accounts/v1/request_otp")
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 \"mobile_number\": \"+6581000001\",\n \"delivery_mode\": \"whatsapp\"\n}"
response = http.request(request)
puts response.read_body{
"is_mobile_verified": true,
"last_otp_delivery_mode": "whatsapp",
"masked_email": "r****************@d***********",
"masked_mobile_number": "*******0001"
}{
"type": "Unauthorized",
"message": "You did not provide valid credentials for this request. Please check your request and try again.",
"details": [
{
"field": "session_id",
"message": "Check if the session ID is set correctly in the X-Session-Id header."
}
]
}{
"type": "Invalid Parameter",
"message": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
]
}{
"type": "Unprocessable Entity",
"message": "The request cannot be processed because it does not meet the needed conditions. Please try again once the conditions are met.",
"details": [
{
"field": "otp",
"message": "rate limit exceeded. Please wait 24 seconds to resend again"
}
]
}{
"type": "Too Many Requests",
"message": "Too many requests. Wait a moment and try again.",
"details": [
{
"field": "otp",
"message": "Too many codes requested. Try again in 10 minutes."
}
]
}Request login code
Sends a one-time login code to a diner who already has an account. It goes by WhatsApp unless you ask for email. last_otp_delivery_mode in the response says how it was sent, so you can tell the diner where to look.
To send the code again, wait 30 seconds. Earlier requests get 422.
A diner with an Atlas account at any merchant gets a code here. If the number has no Atlas account yet, you get 404; call Sign up instead.
POST
/
request_otp
Request login code
curl --request POST \
--url https://api.atlas.kitchen/accounts/v1/request_otp \
--header 'Content-Type: application/json' \
--header 'X-Channel-Id: <api-key>' \
--header 'X-Session-Id: <api-key>' \
--data '
{
"mobile_number": "+6581000001",
"delivery_mode": "whatsapp"
}
'import requests
url = "https://api.atlas.kitchen/accounts/v1/request_otp"
payload = {
"mobile_number": "+6581000001",
"delivery_mode": "whatsapp"
}
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({mobile_number: '+6581000001', delivery_mode: 'whatsapp'})
};
fetch('https://api.atlas.kitchen/accounts/v1/request_otp', 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/request_otp",
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([
'mobile_number' => '+6581000001',
'delivery_mode' => 'whatsapp'
]),
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/request_otp"
payload := strings.NewReader("{\n \"mobile_number\": \"+6581000001\",\n \"delivery_mode\": \"whatsapp\"\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/request_otp")
.header("X-Channel-Id", "<api-key>")
.header("X-Session-Id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"mobile_number\": \"+6581000001\",\n \"delivery_mode\": \"whatsapp\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.atlas.kitchen/accounts/v1/request_otp")
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 \"mobile_number\": \"+6581000001\",\n \"delivery_mode\": \"whatsapp\"\n}"
response = http.request(request)
puts response.read_body{
"is_mobile_verified": true,
"last_otp_delivery_mode": "whatsapp",
"masked_email": "r****************@d***********",
"masked_mobile_number": "*******0001"
}{
"type": "Unauthorized",
"message": "You did not provide valid credentials for this request. Please check your request and try again.",
"details": [
{
"field": "session_id",
"message": "Check if the session ID is set correctly in the X-Session-Id header."
}
]
}{
"type": "Invalid Parameter",
"message": "<string>",
"details": [
{
"field": "<string>",
"message": "<string>"
}
]
}{
"type": "Unprocessable Entity",
"message": "The request cannot be processed because it does not meet the needed conditions. Please try again once the conditions are met.",
"details": [
{
"field": "otp",
"message": "rate limit exceeded. Please wait 24 seconds to resend again"
}
]
}{
"type": "Too Many Requests",
"message": "Too many requests. Wait a moment and try again.",
"details": [
{
"field": "otp",
"message": "Too many codes requested. Try again in 10 minutes."
}
]
}Authorizations
Body
application/json
Was this page helpful?