Subiz API

Agents

Agents Overview

{
  "id": "5733fad324ef891b007b23c8",
String

Agent ID

  "name": "Hung Nguyen",
String

Agent displayed name

  "email": "hung@subiz.com",
String (Email)

Agent email ID

  "username": "hungnguyen",
String

The username of agent

  "language": "vi",
String

Used language code on dashboard

  "timezone": "7",
String

Timezone

  "type": "admin",
String

Type of agent

  "is_owner": 1,
Integer (Int64)

Check whether agent is owner or not

  "status": "active",
String

Check whether this agent is enabled or not

  "created_at": "2016-05-12T04:51:58.882Z"
String (Date-time)

The account's creation date

}

List all agents

Open in API Explorer
GET /agents

This returns all of your agent accounts

Example Request

Format:
curl --request GET \
  --url https://api.subiz.com/v1/agents \
  --header 'accept: application/json' \
  --header 'api-key: YOUR API KEY HERE'
require 'uri'
require 'net/http'

url = URI("https://api.subiz.com/v1/agents")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
request["api-key"] = 'YOUR API KEY HERE'

response = http.request(request)
puts response.read_body
var http = require("https");

var options = {
  "method": "GET",
  "hostname": "api.subiz.com",
  "port": null,
  "path": "/v1/agents",
  "headers": {
    "accept": "application/json",
    "api-key": "YOUR API KEY HERE"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
import http.client

conn = http.client.HTTPSConnection("api.subiz.com")

headers = {
    'accept': "application/json",
    'api-key': "YOUR API KEY HERE"
    }

conn.request("GET", "/v1/agents", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.subiz.com/v1/agents",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "api-key: YOUR API KEY HERE"
  ),
));

$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/ioutil"
)

func main() {

	url := "https://api.subiz.com/v1/agents"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("accept", "application/json")
	req.Header.Add("api-key", "YOUR API KEY HERE")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

Responses

200 OK

OK

Agents List agents
[
  "id": "5733fad324ef891b007b23c8",
String

Agent ID

  "name": "Hung Nguyen",
String

Agent displayed name

  "email": "hung@subiz.com",
String (Email)

Agent email ID

  "username": "hungnguyen",
String

The username of agent

  "language": "vi",
String

Used language code on dashboard

  "timezone": "7",
String

Timezone

  "type": "admin",
String

Type of agent

  "is_owner": 1,
Integer (Int64)

Check whether agent is owner or not

  "status": "active",
String

Check whether this agent is enabled or not

  "created_at": "2016-05-12T04:51:58.882Z"
String (Date-time)

The account's creation date

]

Create an agent

Open in API Explorer
POST /agents

Allows owner/administrator account to add more agents. Note: Additional fields, password need to be provided during creation

Example Request

Format:
curl --request POST \
  --url https://api.subiz.com/v1/agents \
  --header 'accept: application/json' \
  --header 'api-key: YOUR API KEY HERE' \
  --header 'content-type: multipart/form-data; boundary=---011000010111000001101001' \
  --form 'name=Hung Nguyen' \
  --form email=hung@subiz.com \
  --form username=hungnguyen \
  --form password=mypassword \
  --form language=en \
  --form timezone=7 \
  --form type=admin \
  --form status=active
require 'uri'
require 'net/http'

url = URI("https://api.subiz.com/v1/agents")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Post.new(url)
request["accept"] = 'application/json'
request["api-key"] = 'YOUR API KEY HERE'
request["content-type"] = 'multipart/form-data; boundary=---011000010111000001101001'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\nHung Nguyen\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"email\"\r\n\r\nhung@subiz.com\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"username\"\r\n\r\nhungnguyen\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"password\"\r\n\r\nmypassword\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"language\"\r\n\r\nen\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"timezone\"\r\n\r\n7\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"type\"\r\n\r\nadmin\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"status\"\r\n\r\nactive\r\n-----011000010111000001101001--\r\n"

response = http.request(request)
puts response.read_body
var http = require("https");

var options = {
  "method": "POST",
  "hostname": "api.subiz.com",
  "port": null,
  "path": "/v1/agents",
  "headers": {
    "accept": "application/json",
    "api-key": "YOUR API KEY HERE",
    "content-type": "multipart/form-data; boundary=---011000010111000001101001"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\nHung Nguyen\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"email\"\r\n\r\nhung@subiz.com\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"username\"\r\n\r\nhungnguyen\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"password\"\r\n\r\nmypassword\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"language\"\r\n\r\nen\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"timezone\"\r\n\r\n7\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"type\"\r\n\r\nadmin\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"status\"\r\n\r\nactive\r\n-----011000010111000001101001--\r\n");
req.end();
import http.client

conn = http.client.HTTPSConnection("api.subiz.com")

payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\nHung Nguyen\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"email\"\r\n\r\nhung@subiz.com\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"username\"\r\n\r\nhungnguyen\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"password\"\r\n\r\nmypassword\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"language\"\r\n\r\nen\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"timezone\"\r\n\r\n7\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"type\"\r\n\r\nadmin\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"status\"\r\n\r\nactive\r\n-----011000010111000001101001--\r\n"

headers = {
    'accept': "application/json",
    'api-key': "YOUR API KEY HERE",
    'content-type': "multipart/form-data; boundary=---011000010111000001101001"
    }

conn.request("POST", "/v1/agents", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.subiz.com/v1/agents",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\nHung Nguyen\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"email\"\r\n\r\nhung@subiz.com\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"username\"\r\n\r\nhungnguyen\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"password\"\r\n\r\nmypassword\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"language\"\r\n\r\nen\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"timezone\"\r\n\r\n7\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"type\"\r\n\r\nadmin\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"status\"\r\n\r\nactive\r\n-----011000010111000001101001--\r\n",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "api-key: YOUR API KEY HERE",
    "content-type: multipart/form-data; boundary=---011000010111000001101001"
  ),
));

$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/ioutil"
)

func main() {

	url := "https://api.subiz.com/v1/agents"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\nHung Nguyen\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"email\"\r\n\r\nhung@subiz.com\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"username\"\r\n\r\nhungnguyen\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"password\"\r\n\r\nmypassword\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"language\"\r\n\r\nen\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"timezone\"\r\n\r\n7\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"type\"\r\n\r\nadmin\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"status\"\r\n\r\nactive\r\n-----011000010111000001101001--\r\n")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("accept", "application/json")
	req.Header.Add("api-key", "YOUR API KEY HERE")
	req.Header.Add("content-type", "multipart/form-data; boundary=---011000010111000001101001")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

Form Data Parameters

Name Type Required Description Example
name String Required

Name

Hung Nguyen
email String (email) Required

Email

hung@subiz.com
username String Required

Username

hungnguyen
password String (password) Required

Password

mypassword
language String Optional

Dashboard language

en
timezone String Optional

Timezone

7
type String Required

Type

admin
status String Required

Status

active

Responses

201 Created

Created

Agents Agent
{
  "id": "5733fad324ef891b007b23c8",
String

Agent ID

  "name": "Hung Nguyen",
String

Agent displayed name

  "email": "hung@subiz.com",
String (Email)

Agent email ID

  "username": "hungnguyen",
String

The username of agent

  "language": "vi",
String

Used language code on dashboard

  "timezone": "7",
String

Timezone

  "type": "admin",
String

Type of agent

  "is_owner": 1,
Integer (Int64)

Check whether agent is owner or not

  "status": "active",
String

Check whether this agent is enabled or not

  "created_at": "2016-05-12T04:51:58.882Z"
String (Date-time)

The account's creation date

}

Retrieve an agent

Open in API Explorer
GET /agents/{agent_id}

Fetches an agent by his or her ID.

Example Request

Format:
curl --request GET \
  --url https://api.subiz.com/v1/agents/5733fad324ef891b007b23c8 \
  --header 'accept: application/json' \
  --header 'api-key: YOUR API KEY HERE'
require 'uri'
require 'net/http'

url = URI("https://api.subiz.com/v1/agents/5733fad324ef891b007b23c8")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Get.new(url)
request["accept"] = 'application/json'
request["api-key"] = 'YOUR API KEY HERE'

response = http.request(request)
puts response.read_body
var http = require("https");

var options = {
  "method": "GET",
  "hostname": "api.subiz.com",
  "port": null,
  "path": "/v1/agents/5733fad324ef891b007b23c8",
  "headers": {
    "accept": "application/json",
    "api-key": "YOUR API KEY HERE"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
import http.client

conn = http.client.HTTPSConnection("api.subiz.com")

headers = {
    'accept': "application/json",
    'api-key': "YOUR API KEY HERE"
    }

conn.request("GET", "/v1/agents/5733fad324ef891b007b23c8", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.subiz.com/v1/agents/5733fad324ef891b007b23c8",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "api-key: YOUR API KEY HERE"
  ),
));

$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/ioutil"
)

func main() {

	url := "https://api.subiz.com/v1/agents/5733fad324ef891b007b23c8"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("accept", "application/json")
	req.Header.Add("api-key", "YOUR API KEY HERE")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

Path Parameters

Name Type Required Description Example
agent_id String Required

Agent ID

5733fad324ef891b007b23c8

Responses

200 OK

OK

Agents Agent
{
  "id": "5733fad324ef891b007b23c8",
String

Agent ID

  "name": "Hung Nguyen",
String

Agent displayed name

  "email": "hung@subiz.com",
String (Email)

Agent email ID

  "username": "hungnguyen",
String

The username of agent

  "language": "vi",
String

Used language code on dashboard

  "timezone": "7",
String

Timezone

  "type": "admin",
String

Type of agent

  "is_owner": 1,
Integer (Int64)

Check whether agent is owner or not

  "status": "active",
String

Check whether this agent is enabled or not

  "created_at": "2016-05-12T04:51:58.882Z"
String (Date-time)

The account's creation date

}

Update an agent

Open in API Explorer
PUT /agents/{agent_id}

Allows an owner/administrator account to update agent details

Example Request

Format:
curl --request PUT \
  --url https://api.subiz.com/v1/agents/5733fad324ef891b007b23c8 \
  --header 'accept: application/json' \
  --header 'api-key: YOUR API KEY HERE' \
  --header 'content-type: multipart/form-data; boundary=---011000010111000001101001' \
  --form 'name=Hung Nguyen' \
  --form old_password=myoldpassword \
  --form new_password=mynewpassword \
  --form language=vi \
  --form timezone=7 \
  --form type=normal \
  --form status=active
require 'uri'
require 'net/http'

url = URI("https://api.subiz.com/v1/agents/5733fad324ef891b007b23c8")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Put.new(url)
request["accept"] = 'application/json'
request["api-key"] = 'YOUR API KEY HERE'
request["content-type"] = 'multipart/form-data; boundary=---011000010111000001101001'
request.body = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\nHung Nguyen\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"old_password\"\r\n\r\nmyoldpassword\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"new_password\"\r\n\r\nmynewpassword\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"language\"\r\n\r\nvi\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"timezone\"\r\n\r\n7\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"type\"\r\n\r\nnormal\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"status\"\r\n\r\nactive\r\n-----011000010111000001101001--\r\n"

response = http.request(request)
puts response.read_body
var http = require("https");

var options = {
  "method": "PUT",
  "hostname": "api.subiz.com",
  "port": null,
  "path": "/v1/agents/5733fad324ef891b007b23c8",
  "headers": {
    "accept": "application/json",
    "api-key": "YOUR API KEY HERE",
    "content-type": "multipart/form-data; boundary=---011000010111000001101001"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.write("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\nHung Nguyen\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"old_password\"\r\n\r\nmyoldpassword\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"new_password\"\r\n\r\nmynewpassword\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"language\"\r\n\r\nvi\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"timezone\"\r\n\r\n7\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"type\"\r\n\r\nnormal\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"status\"\r\n\r\nactive\r\n-----011000010111000001101001--\r\n");
req.end();
import http.client

conn = http.client.HTTPSConnection("api.subiz.com")

payload = "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\nHung Nguyen\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"old_password\"\r\n\r\nmyoldpassword\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"new_password\"\r\n\r\nmynewpassword\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"language\"\r\n\r\nvi\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"timezone\"\r\n\r\n7\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"type\"\r\n\r\nnormal\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"status\"\r\n\r\nactive\r\n-----011000010111000001101001--\r\n"

headers = {
    'accept': "application/json",
    'api-key': "YOUR API KEY HERE",
    'content-type': "multipart/form-data; boundary=---011000010111000001101001"
    }

conn.request("PUT", "/v1/agents/5733fad324ef891b007b23c8", payload, headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.subiz.com/v1/agents/5733fad324ef891b007b23c8",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "PUT",
  CURLOPT_POSTFIELDS => "-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\nHung Nguyen\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"old_password\"\r\n\r\nmyoldpassword\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"new_password\"\r\n\r\nmynewpassword\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"language\"\r\n\r\nvi\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"timezone\"\r\n\r\n7\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"type\"\r\n\r\nnormal\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"status\"\r\n\r\nactive\r\n-----011000010111000001101001--\r\n",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "api-key: YOUR API KEY HERE",
    "content-type: multipart/form-data; boundary=---011000010111000001101001"
  ),
));

$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/ioutil"
)

func main() {

	url := "https://api.subiz.com/v1/agents/5733fad324ef891b007b23c8"

	payload := strings.NewReader("-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"name\"\r\n\r\nHung Nguyen\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"old_password\"\r\n\r\nmyoldpassword\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"new_password\"\r\n\r\nmynewpassword\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"language\"\r\n\r\nvi\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"timezone\"\r\n\r\n7\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"type\"\r\n\r\nnormal\r\n-----011000010111000001101001\r\nContent-Disposition: form-data; name=\"status\"\r\n\r\nactive\r\n-----011000010111000001101001--\r\n")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("accept", "application/json")
	req.Header.Add("api-key", "YOUR API KEY HERE")
	req.Header.Add("content-type", "multipart/form-data; boundary=---011000010111000001101001")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

Path Parameters

Name Type Required Description Example
agent_id String Required

Agent ID

5733fad324ef891b007b23c8

Form Data Parameters

Name Type Required Description Example
name String Optional

Name

Hung Nguyen
old_password String (password) Optional

Old Password

myoldpassword
new_password String (password) Optional

New Password

mynewpassword
language String Optional

Dashboard language

vi
timezone String Optional

Timezone

7
type String Optional

Agent Type

normal
status String Optional

Agent Status

active

Responses

200 OK

OK

Agents Agent
{
  "id": "5733fad324ef891b007b23c8",
String

Agent ID

  "name": "Hung Nguyen",
String

Agent displayed name

  "email": "hung@subiz.com",
String (Email)

Agent email ID

  "username": "hungnguyen",
String

The username of agent

  "language": "vi",
String

Used language code on dashboard

  "timezone": "7",
String

Timezone

  "type": "admin",
String

Type of agent

  "is_owner": 1,
Integer (Int64)

Check whether agent is owner or not

  "status": "active",
String

Check whether this agent is enabled or not

  "created_at": "2016-05-12T04:51:58.882Z"
String (Date-time)

The account's creation date

}

Delete an agent

Open in API Explorer
DELETE /agents/{agent_id}

Allows an owner/administrator account to delete an agent

Example Request

Format:
curl --request DELETE \
  --url https://api.subiz.com/v1/agents/5733fad324ef891b007b23c8 \
  --header 'accept: application/json' \
  --header 'api-key: YOUR API KEY HERE'
require 'uri'
require 'net/http'

url = URI("https://api.subiz.com/v1/agents/5733fad324ef891b007b23c8")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
http.verify_mode = OpenSSL::SSL::VERIFY_NONE

request = Net::HTTP::Delete.new(url)
request["accept"] = 'application/json'
request["api-key"] = 'YOUR API KEY HERE'

response = http.request(request)
puts response.read_body
var http = require("https");

var options = {
  "method": "DELETE",
  "hostname": "api.subiz.com",
  "port": null,
  "path": "/v1/agents/5733fad324ef891b007b23c8",
  "headers": {
    "accept": "application/json",
    "api-key": "YOUR API KEY HERE"
  }
};

var req = http.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function () {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });
});

req.end();
import http.client

conn = http.client.HTTPSConnection("api.subiz.com")

headers = {
    'accept': "application/json",
    'api-key': "YOUR API KEY HERE"
    }

conn.request("DELETE", "/v1/agents/5733fad324ef891b007b23c8", headers=headers)

res = conn.getresponse()
data = res.read()

print(data.decode("utf-8"))
<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://api.subiz.com/v1/agents/5733fad324ef891b007b23c8",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "DELETE",
  CURLOPT_HTTPHEADER => array(
    "accept: application/json",
    "api-key: YOUR API KEY HERE"
  ),
));

$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/ioutil"
)

func main() {

	url := "https://api.subiz.com/v1/agents/5733fad324ef891b007b23c8"

	req, _ := http.NewRequest("DELETE", url, nil)

	req.Header.Add("accept", "application/json")
	req.Header.Add("api-key", "YOUR API KEY HERE")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := ioutil.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}

Path Parameters

Name Type Required Description Example
agent_id String Required

Agent ID

5733fad324ef891b007b23c8

Responses

204 No Content

Agent deleted successfully

(Empty Response)