Partner API Methods

These methods are only supported for partner accounts. Read more about Ubivox partner accounts on the website.

Note

Refer to your partner manual for the specific semantics regarding client states and approval process. The partner manual can be downloaded from within the Ubivox system by selecting Partner then Partner tools.

partner methods

partner.activate_client(client)

Activate operation of a client.

Parameters:client (integer) – ID of the client.
Returns:true
Return type:boolean
Raises:7001: Invalid client
Raises:7009: Missing address field for customer
partner.approve_client(client)

Approve a client.

Parameters:client (integer) – ID of the client.
Returns:true
Return type:boolean
Raises:7001: Invalid client
Raises:7009: Missing address field for customer
partner.available_account_types()

Retrieves an array of the available account types with IDs suitable for other partner calls.

Returns:An array of structs of:
  • id - ID of the account type
  • name - Name of the account type
Return type:struct
partner.client_details(client)

Fetches contact information for an existing client in Ubivox.

Parameters:client (integer) – The ID of the existing client.
Returns:A struct of:
  • notification_language - Primary language for the client (da, en or es).
  • time_zone - Primary time zone for the client (e.g.: Europe/Copenhagen).
  • contact_name - Name of the primary contact person for the client.
  • contact_email - E-mail address of the primary contact person for the client.
  • contact_phone - Phone number of the primary contact person for the client.
  • company_address_company_name - (Company address) Company name.
  • company_address_vat_number - (Company address) VAT number.
  • company_address - (Company address) Address (multiple lines).
  • company_address_zip - (Company address) Zip code.
  • company_address_city - (Company address) City.
  • company_address_phone - (Company address) Phone number.
  • company_address_country - (Company address) Country (ISO 3166-1 alpha-2 upper case).
  • billing_address_billing_name - (Billing address) Company name.
  • billing_address_vat_number - (Billing address) VAT number.
  • billing_address - (Billing address) Address (multiple lines).
  • billing_address_zip - (Billing address) Zip code.
  • billing_address_city - (Billing address) City.
  • billing_address_phone - (Billing address) Phone number.
  • billing_address_country - (Billing address) Country (ISO 3166-1 alpha-2 upper case).
Return type:struct
Raises:7001: Invalid client
partner.create_client(account_name, language, time_zone, account_type, contact_name, contact_email, contact_phone, company_address_company_name, company_address_vat_number, company_address, company_address_zip, company_address_city, company_address_phone, company_address_country, billing_address_company_name, billing_address_vat_number, billing_address, billing_address_zip, billing_address_city, billing_address_phone, billing_address_country)

Create a new client in Ubivox.

The client will be created in a suspended and unapproved state.

Parameters:
  • account_name (string) – The account name (will be used for hostnames, usernames).
  • language (string) – Primary language for the new client (da, en or es).
  • time_zone (string) – Primary time zone for the new client (e.g.: Europe/Copenhagen).
  • account_type (integer) – The ID of the account type to be used for the new client.
  • contact_name (string) – Name of the primary contact person for the new client.
  • contact_email (string) – E-mail address of the primary contact person for the new client.
  • contact_phone (string) – Phone number of the primary contact person for the new client.
  • company_address_company_name (string) – (Company address) Company name.
  • company_address_vat_number (string) – (Company address) VAT number.
  • company_address (string) – (Company address) Address (multiple lines).
  • company_address_zip (string) – (Company address) Zip code.
  • company_address_city (string) – (Company address) City.
  • company_address_phone (string) – (Company address) Phone number.
  • company_address_country (string) – (Company address) Country (ISO 3166-1 alpha-2 upper case).
  • billing_address_billing_name (string) – (Billing address) Company name.
  • billing_address_vat_number (string) – (Billing address) VAT number.
  • billing_address (string) – (Billing address) Address (multiple lines).
  • billing_address_zip (string) – (Billing address) Zip code.
  • billing_address_city (string) – (Billing address) City.
  • billing_address_phone (string) – (Billing address) Phone number.
  • billing_address_country (string) – (Billing address) Country (ISO 3166-1 alpha-2 upper case).
Returns:

A struct with:

  • id: The ID of the new client.
  • base_url: Base URL of the new client.
  • username: Username of the first, auto generated, user, for the API and feeds.
  • password: Password of the first, auto generated, user
  • api_password: An auto generated API password for API access to this client.
  • feeds_password: An auto generated feeds password for feeds access to this client.

Return type:

struct

Raises:

5006: Invalid language

Raises:

5009: Invalid timezone

Raises:

7006: Account name taken

Raises:

7007: Invalid account type

Raises:

7008: Invalid account name

Raises:

7009: Missing address field for customer

partner.disapprove_client(client)

Disapprove a client.

Parameters:client (integer) – ID of the client.
Returns:true
Return type:boolean
Raises:7001: Invalid client
partner.list_clients()

Fetch a list of your clients on the Ubivox system

Returns:array of struct of:
  • id: The ID of the client.
  • base_url: Base URL of the client.
  • company_address_company_name: Company address: Company name
  • billing_address_company_name: Billing address: Company name
  • contact_name: Primary contact name
  • contact_email: Primary contact e-mail
  • contact_phone: Primary contact phone
  • state: Client state (active or suspended)
  • approved: Approval status (boolean)
Return type:array
partner.sudo(client, method, params)

Execute a method as one of your clients without configuring a new API password for each account.

Parameters:
  • client (integer) – The ID of the client to run the method as.
  • method (string) – The full method name (e.g.: ubivox.ping).
  • params (array) – The parameters for the method (use an empty array for no parameters).
Returns:

The return value of the method used.

Return type:

mixed

Raises:

7001: Invalid client

Raises:

7010: Invalid method

Raises:

May raise any error from the called method.

Note

Supports only methods in the ubivox. and system. namespace.

partner.suspend_client(client)

Suspend operation of a client.

Parameters:client (integer) – ID of the client.
Returns:true
Return type:boolean
Raises:7001: Invalid client
partner.update_client(client, language, time_zone, contact_name, contact_email, contact_phone, company_address_company_name, company_address_vat_number, company_address, company_address_zip, company_address_city, company_address_phone, company_address_country, billing_address_company_name, billing_address_vat_number, billing_address, billing_address_zip, billing_address_city, billing_address_phone, billing_address_country)

Updates contact information for an existing client in Ubivox.

Parameters:
  • client (integer) – The ID of the existing client.
  • language (string) – Primary language for the new client (da, en or es).
  • time_zone (string) – Primary time zone for the new client (e.g.: Europe/Copenhagen).
  • contact_name (string) – Name of the primary contact person for the new client.
  • contact_email (string) – E-mail address of the primary contact person for the new client.
  • contact_phone (string) – Phone number of the primary contact person for the new client.
  • company_address_company_name (string) – (Company address) Company name.
  • company_address_vat_number (string) – (Company address) VAT number.
  • company_address (string) – (Company address) Address (multiple lines).
  • company_address_zip (string) – (Company address) Zip code.
  • company_address_city (string) – (Company address) City.
  • company_address_phone (string) – (Company address) Phone number.
  • company_address_country (string) – (Company address) Country (ISO 3166-1 alpha-2 upper case).
  • billing_address_billing_name (string) – (Billing address) Company name.
  • billing_address_vat_number (string) – (Billing address) VAT number.
  • billing_address (string) – (Billing address) Address (multiple lines).
  • billing_address_zip (string) – (Billing address) Zip code.
  • billing_address_city (string) – (Billing address) City.
  • billing_address_phone (string) – (Billing address) Phone number.
  • billing_address_country (string) – (Billing address) Country (ISO 3166-1 alpha-2 upper case).
Returns:

true

Return type:

boolean

Raises:

5006: Invalid language

Raises:

5009: Invalid timezone

Raises:

7001: Invalid client

Raises:

7009: Missing address field for customer