API - Planyo Web Services - add_agent

Jesteś tutaj: Planyo » Pomoc » API » add_agent

add_agent

Description:

Use this function to add a new agent to a site. You cannot make into an agent a user who is a moderator or resource admin of another Planyo site.
If the user has been added by an admin / API call or is already a moderator or resource admin of the site, they will be automatically assigned as agent. Otherwise, a confirmation email will be sent to the user's email address and the user will be assigned as agent once they confirm the action. Check the status output field to find out if the assignment was immediate. Note that the user should have a login and password associated with their Planyo account. If not, the warning output field will contain the appropriate info.

Input:

user_id int required
ID of the user to be added as agent. The user needs to have an email address associated with their account.
commission string required
The default agent commission expressed in percent or a number, e.g. 10% or 20.00 are both valid. Enter 0 if commission should not be calculated.
discount string required
Enter the default agent discount expressed in percent or a number, e.g. 10% or 20.00 are both valid. Enter 0 if no discount should be applied.
organization string optional
You can optionally enter the name of the organization this agent belongs to. Agents from the same organization (name must match exactly) can view/manage all reservations entered also by other agents from within the same organization.
site_id int optional
Planyo site ID for the new agent. This parameter is only required if using an API key for a meta site.
method string required
must be set to add_agent
language string optional
by specifying a 2-letter (ISO 639-1) language code (all capital letters e.g. EN, DE, FR, ES, IT) you can change the language of the text values returned
api_key string required
your API key - Click here to get your key. If your API key uses a hash key, you must also include the parameters hash_key and hash_timestamp.

Output:

status string
If the agent assignment was successful, this will be one of: ok meaning that the agent role was assigned immediately, or pending if an email confirmation must be done
warning string
Optional warning message. See the description section for more info.

API playground:

Click here to test this function in the API playground.