Create a contact
POST /contacts
curl -X POST "https://app.bualpro.com/api/contacts" \
-H "Content-Type: application/json" \
-H "X-ACCESS-TOKEN: YOUR_API_KEY" \
-d '{
"phone": "+60123456789",
"email": "[email protected]",
"first_name": "Johan",
"last_name": "Ahmad",
"gender": "male",
"actions": [
{
"action": "add_tag",
"tag_name": "YOU_TAG_NAME"
},
{
"action": "set_field_value",
"field_name": "YOU_CUSTOM_FIELD_NAME",
"value": "ANY_VALUE"
},
{
"action": "send_flow",
"flow_id": 11111
}
]
}'
import requests
import json
url = "https://app.bualpro.com/api/contacts"
headers = {
"Content-Type": "application/json",
"X-ACCESS-TOKEN": "YOUR_API_KEY"
}
data = {
"phone": "+60123456789",
"email": "[email protected]",
"first_name": "Johan",
"last_name": "Ahmad",
"gender": "male",
"actions": [
{
"action": "add_tag",
"tag_name": "YOU_TAG_NAME"
},
{
"action": "set_field_value",
"field_name": "YOU_CUSTOM_FIELD_NAME",
"value": "ANY_VALUE"
},
{
"action": "send_flow",
"flow_id": 11111
}
]
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const response = await fetch("https://app.bualpro.com/api/contacts", {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-ACCESS-TOKEN": "YOUR_API_KEY"
},
body: JSON.stringify({
"phone": "+60123456789",
"email": "[email protected]",
"first_name": "Johan",
"last_name": "Ahmad",
"gender": "male",
"actions": [
{
"action": "add_tag",
"tag_name": "YOU_TAG_NAME"
},
{
"action": "set_field_value",
"field_name": "YOU_CUSTOM_FIELD_NAME",
"value": "ANY_VALUE"
},
{
"action": "send_flow",
"flow_id": 11111
}
]
})
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
"encoding/json"
)
func main() {
data := []byte(`{
"phone": "+60123456789",
"email": "[email protected]",
"first_name": "Johan",
"last_name": "Ahmad",
"gender": "male",
"actions": [
{
"action": "add_tag",
"tag_name": "YOU_TAG_NAME"
},
{
"action": "set_field_value",
"field_name": "YOU_CUSTOM_FIELD_NAME",
"value": "ANY_VALUE"
},
{
"action": "send_flow",
"flow_id": 11111
}
]
}`)
req, err := http.NewRequest("POST", "https://app.bualpro.com/api/contacts", bytes.NewBuffer(data))
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("X-ACCESS-TOKEN", "YOUR_API_KEY")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://app.bualpro.com/api/contacts')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Post.new(uri)
request['Content-Type'] = 'application/json'
request['X-ACCESS-TOKEN'] = 'YOUR_API_KEY'
request.body = '{
"phone": "+60123456789",
"email": "[email protected]",
"first_name": "Johan",
"last_name": "Ahmad",
"gender": "male",
"actions": [
{
"action": "add_tag",
"tag_name": "YOU_TAG_NAME"
},
{
"action": "set_field_value",
"field_name": "YOU_CUSTOM_FIELD_NAME",
"value": "ANY_VALUE"
},
{
"action": "send_flow",
"flow_id": 11111
}
]
}'
response = http.request(request)
puts response.body
{}
/contacts
Target server for requests. Edit to use your own host.
API key (sent in header)
The media type of the request body
The phone number with country code
The contact email
Actions can be send flow, add/remove tags, set/unset custom field ...
Request Preview
Response
Response will appear here after sending the request
Authentication
API Key for authentication. Provide your API key in the header.
Body
JohanAhmadmalefemaleunknownActions can be send flow, add/remove tags, set/unset custom field ...
Responses
Creates a new contact.
The source documents response descriptions but no response body schema. Do not infer that the response is empty.