Invite a User to a Portal
Purpose
To invite users to a portal in bulk. This API schedules a job. Use the Get Status API to get the status of the scheduled job.
Request Details
Request URL
{api-domain}/crm/{version}/{personality_module}/actions/portal_invite
Where, personality_module is the API name of the module for which the portal was created
Header
Authorization: Zoho-oauthtoken d92d4xxxxxxxxxxxxx15f52
Scope
scope=ZohoCRM.settings.clientportal.ALL
(or)
Scope=ZohoCRM.settings.clientportal.CREATE
Sample Request
Copiedcurl "https://www.zohoapis.com/crm/v5/Contacts/actions/portal_invite"
-X POST
-H "Authorization: Zoho-oauthtoken 1000.8cb99dxxxxxxxxxxxxx9be93.9b8xxxxxxxxxxxxxxxf"
Input JSON
When you invite users to a portal in bulk, a job will be scheduled in the background. Use the Get Status API to get the status of the scheduled job.
- dataJSON array, mandatory
Contains the following details:
- idstring, mandatory
The record ID of the user you want to invite to the portal.
- user_type_idstring, mandatory
The ID of the user type you want to assign this user with. Use the Get User Types API for this ID.
- typestring, mandatory
Represents whether the user is invited the first time or is re-invited. The possible values are invite and reinvite.
- languagestring, optional
The language code of the user you want to invite to the portal. The default value is en_US. The supported values are "en_US", "en_GB", "bg_BG", "zh_CN", "zh_TW", "hr_HR", "ar_EG", "in_ID", "cs_CZ", "da_DK", "nl_NL", "fr_FR", "de_DE", "hu_HU", "hi_IN", "it_IT", "ja_JP", "pl_PL","pt_BR", "pt_PT", "ru_RU", "es_ES", "sv_SE", "th_TH", "tr_TR", "vi_VN", "ko_KR", and "iw_IL".
Sample Input
Copied{
"portal_invite": [
{
"data": [
{
"id": "5020928000002121016",
"user_type_id": "5020928000000523003",
"type": "invite",
"language": "en_US"
}
]
}
]
}
Possible Errors
- MANDATORY_NOT_FOUNDHTTP 400
You have not specified one or more mandatory keys in the input.
Resolution: Refer to the "details" key in the error response to know what is missing and include it in the request. - INVALID_DATAHTTP 400
The input has invalid data.
Resolution: Refer to the "details" key in the error response to know the api_path and json_path of the incorrect section in the input. - INVALID_REQUEST_METHODHTTP 400
You have specified an incorrect HTTP request method.
Resolution: You must use the HTTP request method POST to use this API. - NO_PERMISSIONHTTP 403
You do not have permission to invite users to the portal.
Resolution: Contact your administrator.
Sample Response
Copied{
"portal_invite": [
{
"code": "SUCCESS",
"details": {
"record_id": "3652397000000388085"
},
"message": "An Invite has been sent to the personality.",
"status": "success"
}
]
}