Roles
Roles define the permissions a user holds in an organization. Use these endpoints to list, create, update, delete, and toggle the status of roles in Zoho Inventory.
Attribute
true and false.true and false.true and false.true and false.true and false.true and false.true and false.true and false.true and false.true and false.true and false.write, read, and none.true and false.true and false.true and false.customer, vendor, and item.true and false.{
"role_id": "982000000006005",
"role_name": "Manager",
"description": "Can view, create, and edit transactions across modules.",
"display_name": "Manager",
"role_type": "custom",
"access_type": "full",
"permissions": [
{
"entity": "invoices",
"can_create": true,
"can_edit": true,
"can_view": true,
"can_delete": false,
"can_approve": false,
"can_edit_locked_records": false,
"full_access": false,
"apply_segment": false,
"vendor_bank_account": false,
"assign_owner": false,
"more_permissions": [
{
"permission": "can_export",
"is_enabled": true
}
],
"field_permissions": [
{
"field_name": "vendor_bank_account",
"permission": "read"
}
]
}
],
"segmentation_details": [
{
"entity_id": "982000000045123",
"entity_type": "customer",
"is_segmentation_enabled": true,
"can_allow_viewing": true,
"can_show_unassigned": false,
"supported_entity_list": [
{
"entity_name": "customer",
"is_enabled": true
}
]
}
]
}
Create a role
Create a role with a set of entity-wise permissions for your organization.
OAuth Scope : ZohoInventory.settings.CREATE
Arguments
true and false.true and false.true and false.true and false.true and false.true and false.true and false.true and false.true and false.true and false.true and false.write, read, and none.true and false.true and false.true and false.customer, vendor, and item.true and false.Query Parameters
parameters_data='{"field1":"value1","field2":"value2"}';
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/inventory/v1/roles?organization_id=10234695"
type: POST
headers: headers_data
content-type: application/json
parameters: parameters_data
connection: <connection_name>
];
info response;
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"field1\":\"value1\",\"field2\":\"value2\"}");
Request request = new Request.Builder()
.url("https://www.zohoapis.com/inventory/v1/roles?organization_id=10234695")
.post(body)
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
const options = {
method: 'POST',
headers: {
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f',
'content-type': 'application/json'
},
body: '{"field1":"value1","field2":"value2"}'
};
fetch('https://www.zohoapis.com/inventory/v1/roles?organization_id=10234695', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import http.client
conn = http.client.HTTPSConnection("www.zohoapis.com")
payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}"
headers = {
'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
'content-type': "application/json"
}
conn.request("POST", "/inventory/v1/roles?organization_id=10234695", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const http = require("https");
const options = {
"method": "POST",
"hostname": "www.zohoapis.com",
"port": null,
"path": "/inventory/v1/roles?organization_id=10234695",
"headers": {
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
"content-type": "application/json"
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({field1: 'value1', field2: 'value2'}));
req.end();
curl --request POST \
--url 'https://www.zohoapis.com/inventory/v1/roles?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'content-type: application/json' \
--data '{"field1":"value1","field2":"value2"}'
{
"role_name": "Manager",
"description": "Can view, create, and edit transactions across modules.",
"display_name": "Manager",
"access_type": "full",
"role_type": "custom",
"permissions": [
{
"entity": "invoices",
"can_create": true,
"can_edit": true,
"can_view": true,
"can_delete": false,
"can_approve": false,
"can_edit_locked_records": false,
"full_access": false,
"apply_segment": false,
"vendor_bank_account": false,
"assign_owner": false,
"more_permissions": [
{
"permission": "can_export",
"is_enabled": true
}
],
"field_permissions": [
{
"field_name": "vendor_bank_account",
"permission": "read"
}
]
}
],
"segmentation_details": [
{
"entity_id": "982000000045123",
"entity_type": "customer",
"is_segmentation_enabled": true,
"can_allow_viewing": true,
"can_show_unassigned": false,
"supported_entity_list": [
{
"entity_name": "customer",
"is_enabled": true
}
]
}
]
}
{
"code": 0,
"message": "The role has been created.",
"role": {
"role_id": "982000000006005",
"role_name": "Manager",
"description": "Can view, create, and edit transactions across modules.",
"display_name": "Manager",
"role_type": "custom",
"access_type": "full",
"permissions": [
{
"entity": "invoices",
"can_create": true,
"can_edit": true,
"can_view": true,
"can_delete": false,
"can_approve": false,
"can_edit_locked_records": false,
"full_access": false,
"apply_segment": false,
"vendor_bank_account": false,
"assign_owner": false,
"more_permissions": [
{
"permission": "can_export",
"is_enabled": true
}
],
"field_permissions": [
{
"field_name": "vendor_bank_account",
"permission": "read"
}
]
}
],
"segmentation_details": [
{
"entity_id": "982000000045123",
"entity_type": "customer",
"is_segmentation_enabled": true,
"can_allow_viewing": true,
"can_show_unassigned": false,
"supported_entity_list": [
{
"entity_name": "customer",
"is_enabled": true
}
]
}
]
}
}
List Roles
Get the list of all roles in the organization. Filter and sort the results using the available query parameters.
OAuth Scope : ZohoInventory.settings.READ
Query Parameters
role_name and role_description.yyyy-mm-dd format. Use created_date_start and created_date_end for a range.yyyy-mm-dd format. Use modified_date_start and modified_date_end for a range.yyyy-mm-dd.yyyy-mm-dd.yyyy-mm-dd.yyyy-mm-dd.columns (array of {index, field, value, comparator} where comparator is with or with_out) and criteria_string.headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/inventory/v1/roles?organization_id=10234695"
type: GET
headers: headers_data
connection: <connection_name>
];
info response;
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://www.zohoapis.com/inventory/v1/roles?organization_id=10234695")
.get()
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.build();
Response response = client.newCall(request).execute();
const options = {
method: 'GET',
headers: {
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
}
};
fetch('https://www.zohoapis.com/inventory/v1/roles?organization_id=10234695', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import http.client
conn = http.client.HTTPSConnection("www.zohoapis.com")
headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }
conn.request("GET", "/inventory/v1/roles?organization_id=10234695", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const http = require("https");
const options = {
"method": "GET",
"hostname": "www.zohoapis.com",
"port": null,
"path": "/inventory/v1/roles?organization_id=10234695",
"headers": {
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
curl --request GET \
--url 'https://www.zohoapis.com/inventory/v1/roles?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
{
"code": 0,
"message": "success",
"roles": [
{
"role_id": "982000000006005",
"role_name": "Manager",
"description": "Can view, create, and edit transactions across modules.",
"display_name": "Manager",
"role_type": "custom",
"access_type": "full",
"permissions": [
{
"entity": "invoices",
"can_create": true,
"can_edit": true,
"can_view": true,
"can_delete": false,
"can_approve": false,
"can_edit_locked_records": false,
"full_access": false,
"apply_segment": false,
"vendor_bank_account": false,
"assign_owner": false,
"more_permissions": [
{
"permission": "can_export",
"is_enabled": true
}
],
"field_permissions": [
{
"field_name": "vendor_bank_account",
"permission": "read"
}
]
}
],
"segmentation_details": [
{
"entity_id": "982000000045123",
"entity_type": "customer",
"is_segmentation_enabled": true,
"can_allow_viewing": true,
"can_show_unassigned": false,
"supported_entity_list": [
{
"entity_name": "customer",
"is_enabled": true
}
]
}
]
},
{...},
{...}
],
"page_context": {
"page": 1,
"per_page": 10,
"has_more_page": false,
"report_name": "Roles",
"applied_filter": "Status.All",
"sort_column": "role_name",
"sort_order": "A"
}
}
Update a role
Update the details of a role.
OAuth Scope : ZohoInventory.settings.UPDATE
Path Parameters
Query Parameters
parameters_data='{"field1":"value1","field2":"value2"}';
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/inventory/v1/roles/982000000006005?organization_id=10234695"
type: PUT
headers: headers_data
content-type: application/json
parameters: parameters_data
connection: <connection_name>
];
info response;
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"field1\":\"value1\",\"field2\":\"value2\"}");
Request request = new Request.Builder()
.url("https://www.zohoapis.com/inventory/v1/roles/982000000006005?organization_id=10234695")
.put(body)
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
const options = {
method: 'PUT',
headers: {
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f',
'content-type': 'application/json'
},
body: '{"field1":"value1","field2":"value2"}'
};
fetch('https://www.zohoapis.com/inventory/v1/roles/982000000006005?organization_id=10234695', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import http.client
conn = http.client.HTTPSConnection("www.zohoapis.com")
payload = "{\"field1\":\"value1\",\"field2\":\"value2\"}"
headers = {
'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
'content-type': "application/json"
}
conn.request("PUT", "/inventory/v1/roles/982000000006005?organization_id=10234695", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const http = require("https");
const options = {
"method": "PUT",
"hostname": "www.zohoapis.com",
"port": null,
"path": "/inventory/v1/roles/982000000006005?organization_id=10234695",
"headers": {
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f",
"content-type": "application/json"
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({field1: 'value1', field2: 'value2'}));
req.end();
curl --request PUT \
--url 'https://www.zohoapis.com/inventory/v1/roles/982000000006005?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f' \
--header 'content-type: application/json' \
--data '{"field1":"value1","field2":"value2"}'
{
"role_name": "Manager",
"description": "Can view, create, and edit transactions across modules.",
"display_name": "Manager",
"access_type": "full",
"role_type": "custom",
"permissions": [
{
"entity": "invoices",
"can_create": true,
"can_edit": true,
"can_view": true,
"can_delete": false,
"can_approve": false,
"can_edit_locked_records": false,
"full_access": false,
"apply_segment": false,
"vendor_bank_account": false,
"assign_owner": false,
"more_permissions": [
{
"permission": "can_export",
"is_enabled": true
}
],
"field_permissions": [
{
"field_name": "vendor_bank_account",
"permission": "read"
}
]
}
],
"segmentation_details": [
{
"entity_id": "982000000045123",
"entity_type": "customer",
"is_segmentation_enabled": true,
"can_allow_viewing": true,
"can_show_unassigned": false,
"supported_entity_list": [
{
"entity_name": "customer",
"is_enabled": true
}
]
}
]
}
{
"code": 0,
"message": "The role information has been updated.",
"role": {
"role_id": "982000000006005",
"role_name": "Manager",
"description": "Can view, create, and edit transactions across modules.",
"display_name": "Manager",
"role_type": "custom",
"access_type": "full",
"permissions": [
{
"entity": "invoices",
"can_create": true,
"can_edit": true,
"can_view": true,
"can_delete": false,
"can_approve": false,
"can_edit_locked_records": false,
"full_access": false,
"apply_segment": false,
"vendor_bank_account": false,
"assign_owner": false,
"more_permissions": [
{
"permission": "can_export",
"is_enabled": true
}
],
"field_permissions": [
{
"field_name": "vendor_bank_account",
"permission": "read"
}
]
}
],
"segmentation_details": [
{
"entity_id": "982000000045123",
"entity_type": "customer",
"is_segmentation_enabled": true,
"can_allow_viewing": true,
"can_show_unassigned": false,
"supported_entity_list": [
{
"entity_name": "customer",
"is_enabled": true
}
]
}
]
}
}
Retrieve a role
Get the details of a role, including its entity-wise permissions.
OAuth Scope : ZohoInventory.settings.READ
Path Parameters
Query Parameters
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/inventory/v1/roles/982000000006005?organization_id=10234695"
type: GET
headers: headers_data
connection: <connection_name>
];
info response;
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://www.zohoapis.com/inventory/v1/roles/982000000006005?organization_id=10234695")
.get()
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.build();
Response response = client.newCall(request).execute();
const options = {
method: 'GET',
headers: {
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
}
};
fetch('https://www.zohoapis.com/inventory/v1/roles/982000000006005?organization_id=10234695', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import http.client
conn = http.client.HTTPSConnection("www.zohoapis.com")
headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }
conn.request("GET", "/inventory/v1/roles/982000000006005?organization_id=10234695", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const http = require("https");
const options = {
"method": "GET",
"hostname": "www.zohoapis.com",
"port": null,
"path": "/inventory/v1/roles/982000000006005?organization_id=10234695",
"headers": {
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
curl --request GET \
--url 'https://www.zohoapis.com/inventory/v1/roles/982000000006005?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
{
"code": 0,
"message": "success",
"role": {
"role_id": "982000000006005",
"role_name": "Manager",
"description": "Can view, create, and edit transactions across modules.",
"display_name": "Manager",
"role_type": "custom",
"access_type": "full",
"permissions": [
{
"entity": "invoices",
"can_create": true,
"can_edit": true,
"can_view": true,
"can_delete": false,
"can_approve": false,
"can_edit_locked_records": false,
"full_access": false,
"apply_segment": false,
"vendor_bank_account": false,
"assign_owner": false,
"more_permissions": [
{
"permission": "can_export",
"is_enabled": true
}
],
"field_permissions": [
{
"field_name": "vendor_bank_account",
"permission": "read"
}
]
}
],
"segmentation_details": [
{
"entity_id": "982000000045123",
"entity_type": "customer",
"is_segmentation_enabled": true,
"can_allow_viewing": true,
"can_show_unassigned": false,
"supported_entity_list": [
{
"entity_name": "customer",
"is_enabled": true
}
]
}
]
}
}
Delete a role
Delete a role from your organization. Roles assigned to active users cannot be deleted.
OAuth Scope : ZohoInventory.settings.DELETE
Path Parameters
Query Parameters
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/inventory/v1/roles/982000000006005?organization_id=10234695"
type: DELETE
headers: headers_data
connection: <connection_name>
];
info response;
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://www.zohoapis.com/inventory/v1/roles/982000000006005?organization_id=10234695")
.delete(null)
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.build();
Response response = client.newCall(request).execute();
const options = {
method: 'DELETE',
headers: {
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
}
};
fetch('https://www.zohoapis.com/inventory/v1/roles/982000000006005?organization_id=10234695', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import http.client
conn = http.client.HTTPSConnection("www.zohoapis.com")
headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }
conn.request("DELETE", "/inventory/v1/roles/982000000006005?organization_id=10234695", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const http = require("https");
const options = {
"method": "DELETE",
"hostname": "www.zohoapis.com",
"port": null,
"path": "/inventory/v1/roles/982000000006005?organization_id=10234695",
"headers": {
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
curl --request DELETE \
--url 'https://www.zohoapis.com/inventory/v1/roles/982000000006005?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
{
"code": 0,
"message": "The role has been deleted."
}
Activate a role
Activate a role to make it available for assignment to users.
OAuth Scope : ZohoInventory.settings.CREATE
Path Parameters
Query Parameters
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/inventory/v1/roles/982000000006005/active?organization_id=10234695"
type: POST
headers: headers_data
connection: <connection_name>
];
info response;
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://www.zohoapis.com/inventory/v1/roles/982000000006005/active?organization_id=10234695")
.post(null)
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.build();
Response response = client.newCall(request).execute();
const options = {
method: 'POST',
headers: {
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
}
};
fetch('https://www.zohoapis.com/inventory/v1/roles/982000000006005/active?organization_id=10234695', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import http.client
conn = http.client.HTTPSConnection("www.zohoapis.com")
headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }
conn.request("POST", "/inventory/v1/roles/982000000006005/active?organization_id=10234695", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const http = require("https");
const options = {
"method": "POST",
"hostname": "www.zohoapis.com",
"port": null,
"path": "/inventory/v1/roles/982000000006005/active?organization_id=10234695",
"headers": {
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
curl --request POST \
--url 'https://www.zohoapis.com/inventory/v1/roles/982000000006005/active?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
{
"code": 0,
"message": "success"
}
Deactivate a role
Deactivate a role to prevent it from being assigned to users.
OAuth Scope : ZohoInventory.settings.CREATE
Path Parameters
Query Parameters
headers_data = Map();
headers_data.put("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f");
response = invokeUrl
[
url: "https://www.zohoapis.com/inventory/v1/roles/982000000006005/inactive?organization_id=10234695"
type: POST
headers: headers_data
connection: <connection_name>
];
info response;
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("https://www.zohoapis.com/inventory/v1/roles/982000000006005/inactive?organization_id=10234695")
.post(null)
.addHeader("Authorization", "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f")
.build();
Response response = client.newCall(request).execute();
const options = {
method: 'POST',
headers: {
Authorization: 'Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
}
};
fetch('https://www.zohoapis.com/inventory/v1/roles/982000000006005/inactive?organization_id=10234695', options)
.then(response => response.json())
.then(response => console.log(response))
.catch(err => console.error(err));
import http.client
conn = http.client.HTTPSConnection("www.zohoapis.com")
headers = { 'Authorization': "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f" }
conn.request("POST", "/inventory/v1/roles/982000000006005/inactive?organization_id=10234695", headers=headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
const http = require("https");
const options = {
"method": "POST",
"hostname": "www.zohoapis.com",
"port": null,
"path": "/inventory/v1/roles/982000000006005/inactive?organization_id=10234695",
"headers": {
"Authorization": "Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f"
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on("data", function (chunk) {
chunks.push(chunk);
});
res.on("end", function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
curl --request POST \
--url 'https://www.zohoapis.com/inventory/v1/roles/982000000006005/inactive?organization_id=10234695' \
--header 'Authorization: Zoho-oauthtoken 1000.41d9xxxxxxxxxxxxxxxxxxxxxxxxc2d1.8fccxxxxxxxxxxxxxxxxxxxxxxxx125f'
{
"code": 0,
"message": "success"
}