Communications
Assign multiple emails to an admin
PUT
/
admin
/
emails
/
assign_admin
Assign multiple emails to an admin
curl --request PUT \
--url https://api.gratona.com/v1/admin/emails/assign_admin \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email_ids": [
"1,2,3"
],
"admin": {
"id": 542,
"email": "dev@gratona.com",
"permissions": "null",
"activated": 1,
"activation_code": "null",
"activated_at": "2017-02-23 04:41:10",
"last_login": "2023-11-22 20:43:34",
"reset_password_code": "null",
"first_name": "Leslie",
"last_name": "Jobs",
"created_at": "2017-02-23T04:40:21.000000Z",
"updated_at": "2023-11-22T20:43:34.000000Z",
"client_id": "207",
"group_id": 301,
"email_verified_at": "null",
"__hevo__database_name": "apphys_new",
"__hevo__ingested_at": 1678920545435,
"__hevo__marked_deleted": 0,
"__hevo__source_modified_at": 1678920204000,
"onboarding_status": "null",
"phone": "null"
}
}
'import requests
url = "https://api.gratona.com/v1/admin/emails/assign_admin"
payload = {
"email_ids": ["1,2,3"],
"admin": {
"id": 542,
"email": "dev@gratona.com",
"permissions": "null",
"activated": 1,
"activation_code": "null",
"activated_at": "2017-02-23 04:41:10",
"last_login": "2023-11-22 20:43:34",
"reset_password_code": "null",
"first_name": "Leslie",
"last_name": "Jobs",
"created_at": "2017-02-23T04:40:21.000000Z",
"updated_at": "2023-11-22T20:43:34.000000Z",
"client_id": "207",
"group_id": 301,
"email_verified_at": "null",
"__hevo__database_name": "apphys_new",
"__hevo__ingested_at": 1678920545435,
"__hevo__marked_deleted": 0,
"__hevo__source_modified_at": 1678920204000,
"onboarding_status": "null",
"phone": "null"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email_ids: ['1,2,3'],
admin: {
id: 542,
email: 'dev@gratona.com',
permissions: 'null',
activated: 1,
activation_code: 'null',
activated_at: '2017-02-23 04:41:10',
last_login: '2023-11-22 20:43:34',
reset_password_code: 'null',
first_name: 'Leslie',
last_name: 'Jobs',
created_at: '2017-02-23T04:40:21.000000Z',
updated_at: '2023-11-22T20:43:34.000000Z',
client_id: '207',
group_id: 301,
email_verified_at: 'null',
__hevo__database_name: 'apphys_new',
__hevo__ingested_at: 1678920545435,
__hevo__marked_deleted: 0,
__hevo__source_modified_at: 1678920204000,
onboarding_status: 'null',
phone: 'null'
}
})
};
fetch('https://api.gratona.com/v1/admin/emails/assign_admin', 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.gratona.com/v1/admin/emails/assign_admin",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'email_ids' => [
'1,2,3'
],
'admin' => [
'id' => 542,
'email' => 'dev@gratona.com',
'permissions' => 'null',
'activated' => 1,
'activation_code' => 'null',
'activated_at' => '2017-02-23 04:41:10',
'last_login' => '2023-11-22 20:43:34',
'reset_password_code' => 'null',
'first_name' => 'Leslie',
'last_name' => 'Jobs',
'created_at' => '2017-02-23T04:40:21.000000Z',
'updated_at' => '2023-11-22T20:43:34.000000Z',
'client_id' => '207',
'group_id' => 301,
'email_verified_at' => 'null',
'__hevo__database_name' => 'apphys_new',
'__hevo__ingested_at' => 1678920545435,
'__hevo__marked_deleted' => 0,
'__hevo__source_modified_at' => 1678920204000,
'onboarding_status' => 'null',
'phone' => 'null'
]
]),
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.gratona.com/v1/admin/emails/assign_admin"
payload := strings.NewReader("{\n \"email_ids\": [\n \"1,2,3\"\n ],\n \"admin\": {\n \"id\": 542,\n \"email\": \"dev@gratona.com\",\n \"permissions\": \"null\",\n \"activated\": 1,\n \"activation_code\": \"null\",\n \"activated_at\": \"2017-02-23 04:41:10\",\n \"last_login\": \"2023-11-22 20:43:34\",\n \"reset_password_code\": \"null\",\n \"first_name\": \"Leslie\",\n \"last_name\": \"Jobs\",\n \"created_at\": \"2017-02-23T04:40:21.000000Z\",\n \"updated_at\": \"2023-11-22T20:43:34.000000Z\",\n \"client_id\": \"207\",\n \"group_id\": 301,\n \"email_verified_at\": \"null\",\n \"__hevo__database_name\": \"apphys_new\",\n \"__hevo__ingested_at\": 1678920545435,\n \"__hevo__marked_deleted\": 0,\n \"__hevo__source_modified_at\": 1678920204000,\n \"onboarding_status\": \"null\",\n \"phone\": \"null\"\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.gratona.com/v1/admin/emails/assign_admin")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email_ids\": [\n \"1,2,3\"\n ],\n \"admin\": {\n \"id\": 542,\n \"email\": \"dev@gratona.com\",\n \"permissions\": \"null\",\n \"activated\": 1,\n \"activation_code\": \"null\",\n \"activated_at\": \"2017-02-23 04:41:10\",\n \"last_login\": \"2023-11-22 20:43:34\",\n \"reset_password_code\": \"null\",\n \"first_name\": \"Leslie\",\n \"last_name\": \"Jobs\",\n \"created_at\": \"2017-02-23T04:40:21.000000Z\",\n \"updated_at\": \"2023-11-22T20:43:34.000000Z\",\n \"client_id\": \"207\",\n \"group_id\": 301,\n \"email_verified_at\": \"null\",\n \"__hevo__database_name\": \"apphys_new\",\n \"__hevo__ingested_at\": 1678920545435,\n \"__hevo__marked_deleted\": 0,\n \"__hevo__source_modified_at\": 1678920204000,\n \"onboarding_status\": \"null\",\n \"phone\": \"null\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/emails/assign_admin")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email_ids\": [\n \"1,2,3\"\n ],\n \"admin\": {\n \"id\": 542,\n \"email\": \"dev@gratona.com\",\n \"permissions\": \"null\",\n \"activated\": 1,\n \"activation_code\": \"null\",\n \"activated_at\": \"2017-02-23 04:41:10\",\n \"last_login\": \"2023-11-22 20:43:34\",\n \"reset_password_code\": \"null\",\n \"first_name\": \"Leslie\",\n \"last_name\": \"Jobs\",\n \"created_at\": \"2017-02-23T04:40:21.000000Z\",\n \"updated_at\": \"2023-11-22T20:43:34.000000Z\",\n \"client_id\": \"207\",\n \"group_id\": 301,\n \"email_verified_at\": \"null\",\n \"__hevo__database_name\": \"apphys_new\",\n \"__hevo__ingested_at\": 1678920545435,\n \"__hevo__marked_deleted\": 0,\n \"__hevo__source_modified_at\": 1678920204000,\n \"onboarding_status\": \"null\",\n \"phone\": \"null\"\n }\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>"
}{
"message": "<string>"
}Authorizations
bearerAuthapiKeyAuth
Passport bearer token authentication for legacy admin sessions.
Body
application/json
Admin id and email id to assign
Response
Successful operation
The status of the operation
⌘I
Assign multiple emails to an admin
curl --request PUT \
--url https://api.gratona.com/v1/admin/emails/assign_admin \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"email_ids": [
"1,2,3"
],
"admin": {
"id": 542,
"email": "dev@gratona.com",
"permissions": "null",
"activated": 1,
"activation_code": "null",
"activated_at": "2017-02-23 04:41:10",
"last_login": "2023-11-22 20:43:34",
"reset_password_code": "null",
"first_name": "Leslie",
"last_name": "Jobs",
"created_at": "2017-02-23T04:40:21.000000Z",
"updated_at": "2023-11-22T20:43:34.000000Z",
"client_id": "207",
"group_id": 301,
"email_verified_at": "null",
"__hevo__database_name": "apphys_new",
"__hevo__ingested_at": 1678920545435,
"__hevo__marked_deleted": 0,
"__hevo__source_modified_at": 1678920204000,
"onboarding_status": "null",
"phone": "null"
}
}
'import requests
url = "https://api.gratona.com/v1/admin/emails/assign_admin"
payload = {
"email_ids": ["1,2,3"],
"admin": {
"id": 542,
"email": "dev@gratona.com",
"permissions": "null",
"activated": 1,
"activation_code": "null",
"activated_at": "2017-02-23 04:41:10",
"last_login": "2023-11-22 20:43:34",
"reset_password_code": "null",
"first_name": "Leslie",
"last_name": "Jobs",
"created_at": "2017-02-23T04:40:21.000000Z",
"updated_at": "2023-11-22T20:43:34.000000Z",
"client_id": "207",
"group_id": 301,
"email_verified_at": "null",
"__hevo__database_name": "apphys_new",
"__hevo__ingested_at": 1678920545435,
"__hevo__marked_deleted": 0,
"__hevo__source_modified_at": 1678920204000,
"onboarding_status": "null",
"phone": "null"
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
email_ids: ['1,2,3'],
admin: {
id: 542,
email: 'dev@gratona.com',
permissions: 'null',
activated: 1,
activation_code: 'null',
activated_at: '2017-02-23 04:41:10',
last_login: '2023-11-22 20:43:34',
reset_password_code: 'null',
first_name: 'Leslie',
last_name: 'Jobs',
created_at: '2017-02-23T04:40:21.000000Z',
updated_at: '2023-11-22T20:43:34.000000Z',
client_id: '207',
group_id: 301,
email_verified_at: 'null',
__hevo__database_name: 'apphys_new',
__hevo__ingested_at: 1678920545435,
__hevo__marked_deleted: 0,
__hevo__source_modified_at: 1678920204000,
onboarding_status: 'null',
phone: 'null'
}
})
};
fetch('https://api.gratona.com/v1/admin/emails/assign_admin', 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.gratona.com/v1/admin/emails/assign_admin",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'email_ids' => [
'1,2,3'
],
'admin' => [
'id' => 542,
'email' => 'dev@gratona.com',
'permissions' => 'null',
'activated' => 1,
'activation_code' => 'null',
'activated_at' => '2017-02-23 04:41:10',
'last_login' => '2023-11-22 20:43:34',
'reset_password_code' => 'null',
'first_name' => 'Leslie',
'last_name' => 'Jobs',
'created_at' => '2017-02-23T04:40:21.000000Z',
'updated_at' => '2023-11-22T20:43:34.000000Z',
'client_id' => '207',
'group_id' => 301,
'email_verified_at' => 'null',
'__hevo__database_name' => 'apphys_new',
'__hevo__ingested_at' => 1678920545435,
'__hevo__marked_deleted' => 0,
'__hevo__source_modified_at' => 1678920204000,
'onboarding_status' => 'null',
'phone' => 'null'
]
]),
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.gratona.com/v1/admin/emails/assign_admin"
payload := strings.NewReader("{\n \"email_ids\": [\n \"1,2,3\"\n ],\n \"admin\": {\n \"id\": 542,\n \"email\": \"dev@gratona.com\",\n \"permissions\": \"null\",\n \"activated\": 1,\n \"activation_code\": \"null\",\n \"activated_at\": \"2017-02-23 04:41:10\",\n \"last_login\": \"2023-11-22 20:43:34\",\n \"reset_password_code\": \"null\",\n \"first_name\": \"Leslie\",\n \"last_name\": \"Jobs\",\n \"created_at\": \"2017-02-23T04:40:21.000000Z\",\n \"updated_at\": \"2023-11-22T20:43:34.000000Z\",\n \"client_id\": \"207\",\n \"group_id\": 301,\n \"email_verified_at\": \"null\",\n \"__hevo__database_name\": \"apphys_new\",\n \"__hevo__ingested_at\": 1678920545435,\n \"__hevo__marked_deleted\": 0,\n \"__hevo__source_modified_at\": 1678920204000,\n \"onboarding_status\": \"null\",\n \"phone\": \"null\"\n }\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.gratona.com/v1/admin/emails/assign_admin")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"email_ids\": [\n \"1,2,3\"\n ],\n \"admin\": {\n \"id\": 542,\n \"email\": \"dev@gratona.com\",\n \"permissions\": \"null\",\n \"activated\": 1,\n \"activation_code\": \"null\",\n \"activated_at\": \"2017-02-23 04:41:10\",\n \"last_login\": \"2023-11-22 20:43:34\",\n \"reset_password_code\": \"null\",\n \"first_name\": \"Leslie\",\n \"last_name\": \"Jobs\",\n \"created_at\": \"2017-02-23T04:40:21.000000Z\",\n \"updated_at\": \"2023-11-22T20:43:34.000000Z\",\n \"client_id\": \"207\",\n \"group_id\": 301,\n \"email_verified_at\": \"null\",\n \"__hevo__database_name\": \"apphys_new\",\n \"__hevo__ingested_at\": 1678920545435,\n \"__hevo__marked_deleted\": 0,\n \"__hevo__source_modified_at\": 1678920204000,\n \"onboarding_status\": \"null\",\n \"phone\": \"null\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gratona.com/v1/admin/emails/assign_admin")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email_ids\": [\n \"1,2,3\"\n ],\n \"admin\": {\n \"id\": 542,\n \"email\": \"dev@gratona.com\",\n \"permissions\": \"null\",\n \"activated\": 1,\n \"activation_code\": \"null\",\n \"activated_at\": \"2017-02-23 04:41:10\",\n \"last_login\": \"2023-11-22 20:43:34\",\n \"reset_password_code\": \"null\",\n \"first_name\": \"Leslie\",\n \"last_name\": \"Jobs\",\n \"created_at\": \"2017-02-23T04:40:21.000000Z\",\n \"updated_at\": \"2023-11-22T20:43:34.000000Z\",\n \"client_id\": \"207\",\n \"group_id\": 301,\n \"email_verified_at\": \"null\",\n \"__hevo__database_name\": \"apphys_new\",\n \"__hevo__ingested_at\": 1678920545435,\n \"__hevo__marked_deleted\": 0,\n \"__hevo__source_modified_at\": 1678920204000,\n \"onboarding_status\": \"null\",\n \"phone\": \"null\"\n }\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>"
}{
"message": "<string>"
}