Profiles
Create
Create a profile for your enduser.
POST
/
profiles
/
create
Create
curl --request POST \
--url https://api.buybase.ai/profiles/create \
--header 'authorization: <authorization>'import requests
url = "https://api.buybase.ai/profiles/create"
headers = {"authorization": "<authorization>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {authorization: '<authorization>'}};
fetch('https://api.buybase.ai/profiles/create', 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.buybase.ai/profiles/create",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.buybase.ai/profiles/create"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("authorization", "<authorization>")
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.buybase.ai/profiles/create")
.header("authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.buybase.ai/profiles/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"success": true,
"profile": {
"id": "prof_12345",
"dev_id": "dev_67890",
"created_at": "2023-09-15T14:22:31Z"
},
"code": "PROFILE_CREATED"
}
Headers
string
required
Your API key for authorization.
Body Parameters
No additional parameters required. The profile will be created for the authenticated developer.Response
boolean
Indicates whether the operation was successful.
object
The created profile object.
string
A code indicating the result of the operation. Possible values:
PROFILE_CREATED: Profile created successfullyPROFILE_CREATION_FAILED: Failed to create profile
string
Error message if the request fails.
A profile is automatically associated with the authenticated developer. Each developer can have multiple profiles.
{
"success": true,
"profile": {
"id": "prof_12345",
"dev_id": "dev_67890",
"created_at": "2023-09-15T14:22:31Z"
},
"code": "PROFILE_CREATED"
}
⌘I
Create
curl --request POST \
--url https://api.buybase.ai/profiles/create \
--header 'authorization: <authorization>'import requests
url = "https://api.buybase.ai/profiles/create"
headers = {"authorization": "<authorization>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {authorization: '<authorization>'}};
fetch('https://api.buybase.ai/profiles/create', 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.buybase.ai/profiles/create",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"authorization: <authorization>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.buybase.ai/profiles/create"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("authorization", "<authorization>")
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.buybase.ai/profiles/create")
.header("authorization", "<authorization>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.buybase.ai/profiles/create")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["authorization"] = '<authorization>'
response = http.request(request)
puts response.read_body{
"success": true,
"profile": {
"id": "prof_12345",
"dev_id": "dev_67890",
"created_at": "2023-09-15T14:22:31Z"
},
"code": "PROFILE_CREATED"
}