Address
CreateAddress
POST
https://api.opentact.org/rest/address
This will create an address
Headers
Name
Type
Description
Content-Type
string
application/json
X-Auth-Token
string
JWT
Request Body
Name
Type
Description
name
string
<= 24 characters
is_physical
boolean
Default: "true"
is_billing
boolean
Default: "true"
is_shipping
boolean
Default: "true"
address1
string
<= 255 characters
address2
string
<= 255 characters
zip_code
string
<= 12 characters
city
string
<= 255 characters
country
string
<= 2 characters
a2 field from a DICTCountry dictionary
{
"success": true,
"payload": {
"created_on": "2019-08-24T14:15:22Z",
"modified_on": "2019-08-24T14:15:22Z",
"uuid": "string",
"name": "string",
"is_physical": true,
"is_billing": true,
"is_shipping": true,
"address1": "string",
"address2": "string",
"zip_code": "string",
"city": "string",
"country": {
"created_on": "2019-08-24T14:15:22Z",
"modified_on": "2019-08-24T14:15:22Z",
"name": "string",
"a2": "st",
"a3": "str",
"n": 1
},
"user": {
"created_on": "2019-08-24T14:15:22Z",
"modified_on": "2019-08-24T14:15:22Z",
"uuid": "string",
"email": "string",
"password": "string",
"phone_number": "string",
"first_name": "string",
"last_name": "string",
"avatar": "string",
"gender": "Agender",
"dob": "2019-08-24T14:15:22Z",
"role": "Admin",
"gmail_user_id": "string",
"facebook_user_id": "string",
"apple_user_id": "string",
"wechat_user_id": "string",
"deleted_on": "2019-08-24T14:15:22Z",
"token": "string",
"account": {}
},
"account": {
"created_on": "2019-08-24T14:15:22Z",
"modified_on": "2019-08-24T14:15:22Z",
"uuid": "string",
"name": "string",
"email": "string",
"level": "ServiceAccount",
"balance": 0,
"class4_id": 0,
"deleted_on": "2019-08-24T14:15:22Z",
"time_zone": {},
"users": [],
"admin": {},
"messaging_profile_default": {},
"messaging_profiles": [],
"addresses": []
},
"created_by": {
"created_on": "2019-08-24T14:15:22Z",
"modified_on": "2019-08-24T14:15:22Z",
"uuid": "string",
"email": "string",
"password": "string",
"phone_number": "string",
"first_name": "string",
"last_name": "string",
"avatar": "string",
"gender": "Agender",
"dob": "2019-08-24T14:15:22Z",
"role": "Admin",
"gmail_user_id": "string",
"facebook_user_id": "string",
"apple_user_id": "string",
"wechat_user_id": "string",
"deleted_on": "2019-08-24T14:15:22Z",
"token": "string",
"account": {}
},
"modified_by": {
"created_on": "2019-08-24T14:15:22Z",
"modified_on": "2019-08-24T14:15:22Z",
"uuid": "string",
"email": "string",
"password": "string",
"phone_number": "string",
"first_name": "string",
"last_name": "string",
"avatar": "string",
"gender": "Agender",
"dob": "2019-08-24T14:15:22Z",
"role": "Admin",
"gmail_user_id": "string",
"facebook_user_id": "string",
"apple_user_id": "string",
"wechat_user_id": "string",
"deleted_on": "2019-08-24T14:15:22Z",
"token": "string",
"account": {}
}
}
}
{
"success": true,
"payload": {
"created_on": "2019-08-24T14:15:22Z",
"modified_on": "2019-08-24T14:15:22Z",
"uuid": "string",
"name": "string",
"is_physical": true,
"is_billing": true,
"is_shipping": true,
"address1": "string",
"address2": "string",
"zip_code": "string",
"city": "string",
"country": {},
"user": {},
"account": {},
"created_by": {},
"modified_by": {}
}
}
{
"success": false,
"message": "string",
"status": 0
}
{
"success": false,
"message": "string",
"status": 0
}
Code Example
curl -X POST "https://api.opentact.org/rest/address" \
-H "accept: application/json" -H "X-Auth-Token: JWT_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"name\":\"string\",\"is_physical\":true,\"is_billing\":true,\"is_shipping\":true,\"address1\":\"string\",\"address2\":\"string\",\"zip_code\":\"string\",\"city\":\"string\",\"country\":\"string\"}"
<?php
include('vendor/rmccue/requests/library/Requests.php');
Requests::register_autoloader();
$headers = array(
'accept' => 'application/json',
'X-Auth-Token' => 'JWT_TOKEN',
'Content-Type' => 'application/json'
);
$data = '{"name":"string","is_physical":true,"is_billing":true,"is_shipping":true,"address1":"string","address2":"string","zip_code":"string","city":"string","country":"string"}';
$response = Requests::post('https://api.opentact.org/rest/address', $headers, $data);
import requests
headers = {
'accept': 'application/json',
'X-Auth-Token': 'JWT_TOKEN',
'Content-Type': 'application/json',
}
data = '{"name":"string","is_physical":true,"is_billing":true,"is_shipping":true,"address1":"string","address2":"string","zip_code":"string","city":"string","country":"string"}'
response = requests.post('https://api.opentact.org/rest/address', headers=headers, data=data)
var fetch = require('node-fetch');
fetch('https://api.opentact.org/rest/address', {
method: 'POST',
headers: {
'accept': 'application/json',
'X-Auth-Token': 'JWT_TOKEN',
'Content-Type': 'application/json'
},
body: JSON.stringify({"name":"string","is_physical":true,"is_billing":true,"is_shipping":true,"address1":"string","address2":"string","zip_code":"string","city":"string","country":"string"})
});
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
"strings"
)
func main() {
client := &http.Client{}
var data = strings.NewReader(`{"name":"string","is_physical":true,"is_billing":true,"is_shipping":true,"address1":"string","address2":"string","zip_code":"string","city":"string","country":"string"}`)
req, err := http.NewRequest("POST", "https://api.opentact.org/rest/address", data)
if err != nil {
log.Fatal(err)
}
req.Header.Set("accept", "application/json")
req.Header.Set("X-Auth-Token", "JWT_TOKEN")
req.Header.Set("Content-Type", "application/json")
resp, err := client.Do(req)
if err != nil {
log.Fatal(err)
}
bodyText, err := ioutil.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%s\n", bodyText)
}
GetAddressListByAccount
GET
https://api.opentact.org/rest/address/{account}
This will return an address related to an account
Headers
Name
Type
Description
X-Auth-Token
string
JWT
{
"success": true,
"payload": [
{
"created_on": "2019-08-24T14:15:22Z",
"modified_on": "2019-08-24T14:15:22Z",
"uuid": "string",
"name": "string",
"is_physical": true,
"is_billing": true,
"is_shipping": true,
"address1": "string",
"address2": "string",
"zip_code": "string",
"city": "string",
"country": {},
"user": {},
"account": {},
"created_by": {},
"modified_by": {}
}
]
}
{
"success": false,
"message": "string",
"status": 0
}
Code Example
curl -X GET "https://api.opentact.org/rest/address/account" \
-H "accept: application/json" -H "X-Auth-Token: JWT_TOKEN"
<?php
include('vendor/rmccue/requests/library/Requests.php');
Requests::register_autoloader();
$headers = array(
'accept' => 'application/json',
'X-Auth-Token' => 'JWT_TOKEN'
);
$response = Requests::get('https://api.opentact.org/rest/address/account', $headers);
import requests
headers = {
'accept': 'application/json',
'X-Auth-Token': 'JWT_TOKEN',
}
response = requests.get('https://api.opentact.org/rest/address/account', headers=headers)
var fetch = require('node-fetch');
fetch('https://api.opentact.org/rest/address/account', {
headers: {
'accept': 'application/json',
'X-Auth-Token': 'JWT_TOKEN'
}
});
package main
import (
"fmt"
"io/ioutil"
"log"
"net/http"
)
func main() {
client := &http.Client{}
req, err := http.NewRequest("GET", "https://api.opentact.org/rest/address/account", nil)
if err != nil {
log.Fatal(err)
}
req.Header.Set("accept", "application/json")
req.Header.Set("X-Auth-Token", "JWT_TOKEN")
resp, err := client.Do(req)
if err != nil {
log.Fatal(err)
}
bodyText, err := ioutil.ReadAll(resp.Body)
if err != nil {
log.Fatal(err)
}
fmt.Printf("%s\n", bodyText)
}
Last updated
Was this helpful?