(DEPRECATED) Edit schedules of an account.
curl --request POST \
--url https://api.togai.com/accounts/{account_id}/edit_schedules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"edits": [
{
"mode": "ASSOCIATE",
"pricePlanId": "pp.1zYnCiM9Bpg.lv25y",
"effectiveFrom": "2022-07-04",
"effectiveUntil": "2022-10-04"
},
{
"mode": "DISASSOCIATE",
"effectiveFrom": "2022-08-04",
"effectiveUntil": "2022-09-04"
}
]
}
'import requests
url = "https://api.togai.com/accounts/{account_id}/edit_schedules"
payload = { "edits": [
{
"mode": "ASSOCIATE",
"pricePlanId": "pp.1zYnCiM9Bpg.lv25y",
"effectiveFrom": "2022-07-04",
"effectiveUntil": "2022-10-04"
},
{
"mode": "DISASSOCIATE",
"effectiveFrom": "2022-08-04",
"effectiveUntil": "2022-09-04"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
edits: [
{
mode: 'ASSOCIATE',
pricePlanId: 'pp.1zYnCiM9Bpg.lv25y',
effectiveFrom: '2022-07-04',
effectiveUntil: '2022-10-04'
},
{
mode: 'DISASSOCIATE',
effectiveFrom: '2022-08-04',
effectiveUntil: '2022-09-04'
}
]
})
};
fetch('https://api.togai.com/accounts/{account_id}/edit_schedules', 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.togai.com/accounts/{account_id}/edit_schedules",
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([
'edits' => [
[
'mode' => 'ASSOCIATE',
'pricePlanId' => 'pp.1zYnCiM9Bpg.lv25y',
'effectiveFrom' => '2022-07-04',
'effectiveUntil' => '2022-10-04'
],
[
'mode' => 'DISASSOCIATE',
'effectiveFrom' => '2022-08-04',
'effectiveUntil' => '2022-09-04'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.togai.com/accounts/{account_id}/edit_schedules"
payload := strings.NewReader("{\n \"edits\": [\n {\n \"mode\": \"ASSOCIATE\",\n \"pricePlanId\": \"pp.1zYnCiM9Bpg.lv25y\",\n \"effectiveFrom\": \"2022-07-04\",\n \"effectiveUntil\": \"2022-10-04\"\n },\n {\n \"mode\": \"DISASSOCIATE\",\n \"effectiveFrom\": \"2022-08-04\",\n \"effectiveUntil\": \"2022-09-04\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.togai.com/accounts/{account_id}/edit_schedules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"edits\": [\n {\n \"mode\": \"ASSOCIATE\",\n \"pricePlanId\": \"pp.1zYnCiM9Bpg.lv25y\",\n \"effectiveFrom\": \"2022-07-04\",\n \"effectiveUntil\": \"2022-10-04\"\n },\n {\n \"mode\": \"DISASSOCIATE\",\n \"effectiveFrom\": \"2022-08-04\",\n \"effectiveUntil\": \"2022-09-04\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.togai.com/accounts/{account_id}/edit_schedules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"edits\": [\n {\n \"mode\": \"ASSOCIATE\",\n \"pricePlanId\": \"pp.1zYnCiM9Bpg.lv25y\",\n \"effectiveFrom\": \"2022-07-04\",\n \"effectiveUntil\": \"2022-10-04\"\n },\n {\n \"mode\": \"DISASSOCIATE\",\n \"effectiveFrom\": \"2022-08-04\",\n \"effectiveUntil\": \"2022-09-04\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"accountId": "G234DZZKBKACATFFGVGEMERFI",
"accountName": "ACME Enterprise - Account2",
"pricingSchedules": [
{
"id": "sch.4325kbjedsc.34dww",
"pricePlanId": "pp.1zYnCiM9Bpg.lv25y",
"pricePlanName": "ENTERPRISE_PLAN",
"startDate": "2022-12-02T00:00:00Z",
"endDate": "9999-01-01T00:00:00Z"
}
]
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}(Deprecated) Plan Associations
(DEPRECATED) Edit schedules of an account.
This API let’s you to detach/attach one or more price plans from/to an existing account
POST
/
accounts
/
{account_id}
/
edit_schedules
(DEPRECATED) Edit schedules of an account.
curl --request POST \
--url https://api.togai.com/accounts/{account_id}/edit_schedules \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"edits": [
{
"mode": "ASSOCIATE",
"pricePlanId": "pp.1zYnCiM9Bpg.lv25y",
"effectiveFrom": "2022-07-04",
"effectiveUntil": "2022-10-04"
},
{
"mode": "DISASSOCIATE",
"effectiveFrom": "2022-08-04",
"effectiveUntil": "2022-09-04"
}
]
}
'import requests
url = "https://api.togai.com/accounts/{account_id}/edit_schedules"
payload = { "edits": [
{
"mode": "ASSOCIATE",
"pricePlanId": "pp.1zYnCiM9Bpg.lv25y",
"effectiveFrom": "2022-07-04",
"effectiveUntil": "2022-10-04"
},
{
"mode": "DISASSOCIATE",
"effectiveFrom": "2022-08-04",
"effectiveUntil": "2022-09-04"
}
] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
edits: [
{
mode: 'ASSOCIATE',
pricePlanId: 'pp.1zYnCiM9Bpg.lv25y',
effectiveFrom: '2022-07-04',
effectiveUntil: '2022-10-04'
},
{
mode: 'DISASSOCIATE',
effectiveFrom: '2022-08-04',
effectiveUntil: '2022-09-04'
}
]
})
};
fetch('https://api.togai.com/accounts/{account_id}/edit_schedules', 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.togai.com/accounts/{account_id}/edit_schedules",
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([
'edits' => [
[
'mode' => 'ASSOCIATE',
'pricePlanId' => 'pp.1zYnCiM9Bpg.lv25y',
'effectiveFrom' => '2022-07-04',
'effectiveUntil' => '2022-10-04'
],
[
'mode' => 'DISASSOCIATE',
'effectiveFrom' => '2022-08-04',
'effectiveUntil' => '2022-09-04'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$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.togai.com/accounts/{account_id}/edit_schedules"
payload := strings.NewReader("{\n \"edits\": [\n {\n \"mode\": \"ASSOCIATE\",\n \"pricePlanId\": \"pp.1zYnCiM9Bpg.lv25y\",\n \"effectiveFrom\": \"2022-07-04\",\n \"effectiveUntil\": \"2022-10-04\"\n },\n {\n \"mode\": \"DISASSOCIATE\",\n \"effectiveFrom\": \"2022-08-04\",\n \"effectiveUntil\": \"2022-09-04\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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.togai.com/accounts/{account_id}/edit_schedules")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"edits\": [\n {\n \"mode\": \"ASSOCIATE\",\n \"pricePlanId\": \"pp.1zYnCiM9Bpg.lv25y\",\n \"effectiveFrom\": \"2022-07-04\",\n \"effectiveUntil\": \"2022-10-04\"\n },\n {\n \"mode\": \"DISASSOCIATE\",\n \"effectiveFrom\": \"2022-08-04\",\n \"effectiveUntil\": \"2022-09-04\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.togai.com/accounts/{account_id}/edit_schedules")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"edits\": [\n {\n \"mode\": \"ASSOCIATE\",\n \"pricePlanId\": \"pp.1zYnCiM9Bpg.lv25y\",\n \"effectiveFrom\": \"2022-07-04\",\n \"effectiveUntil\": \"2022-10-04\"\n },\n {\n \"mode\": \"DISASSOCIATE\",\n \"effectiveFrom\": \"2022-08-04\",\n \"effectiveUntil\": \"2022-09-04\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"accountId": "G234DZZKBKACATFFGVGEMERFI",
"accountName": "ACME Enterprise - Account2",
"pricingSchedules": [
{
"id": "sch.4325kbjedsc.34dww",
"pricePlanId": "pp.1zYnCiM9Bpg.lv25y",
"pricePlanName": "ENTERPRISE_PLAN",
"startDate": "2022-12-02T00:00:00Z",
"endDate": "9999-01-01T00:00:00Z"
}
]
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}{
"message": "<Reason message>"
}Deprecated: This API is deprecated and will be removed in a future release. Please use the Bulk edit schedules of an account instead for updated functionality.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
account_id corresponding to an account
Maximum string length:
50Example:
"ACC00001"
Query Parameters
Example:
false
Body
application/json
Payload to dis/associate one or more price plans to an account
Request to dis/associate one or more schedules to an account
Required array length:
1 - 10 elementsShow child attributes
Show child attributes
(DEPRECATED) List pricing schedules of an account(DEPRECATED) Dissociate or associate a price plan with an account
⌘I
