Log In  |  Sign Up  |  Help

Accounts

An Account instance resource represents a single DudaMobile Account. There are two account types referenced below, master account and sub-user account. The master account is the DudaWhite account that accesses the Duda API. A sub-user account references the account created by the master account which can be granted access to site(s) in the master account. Only DudaWhite partner accounts have access to sub-user options.

Resource URIs

Create Account

Create a new sub-user account. This account will be used for your end users to log in (via SSO). This must be created before granting access to sub-user. We recommend using your customers email address as the account name. Once an account is created, you cannot change the name.

POST /accounts/create

Parameters:

Account resource JSON structure that should be POSTed:

PropertyTypeRequiredDescription
account_name String required Must be unique value across all Accounts (max 45 chars)
first_name alphabetic string (ASCII) optional The account holder first name (max 45 chars)
last_name alphabetic string (ASCII) optional The account holder last name (max 45 chars)
email email optional The account holder email (max 150 chars)
lang String optional The account's locale (en, es, ja)

Return:

None

Errors:

ResourceAlreadyExistInvalidInput

Example:
POST /accounts/create 
{ 
  "account_name": "johnl2@yahoo.com", 
  "first_name": "John", 
  "last_name": "Lewis", 
  "email": "johnl@yahoo.com"
}

Retrieve Account

Get information from the DudaMobile platform about an existing account. You should know the account name already, as you used it to originally create the account.

GET /accounts/{account_name}

Parameters:

account_name - URL parameter - account name

Return:

The following JSON structure representing the Account:

PropertyTypeDescription
account_name String The account name of mobile sites owner. The account name is a unique identifier of the Account.
first_name alphabetic string The account holder first name
last_name alphabetic string The account holder last name
email email string The account holder email

Errors:

ResourceNotExist

Example:
GET /accounts/johnl2@yahoo.com
{ 
  "account_name": "johnl2@yahoo.com"
  "first_name": "John", 
  "last_name": "Lewis", 
  "email": "johnl@yahoo.com" 
}

Delete Account

Delete an existing sub-account. This account must be a sub-account you've already created.

DELETE /account/{account_name}

Parameters:

account_name - URL parameter - account name

Return:

If successful, a 204 (no content) will be the response.

Errors:

400 status code - ResourceNotExist

Update Account

Update the parameters/settings for an existing account on a DudaMobile account. This is useful for updating email, name or language settings.

POST /accounts/update/{account_name}

Parameters:

account_name - url parameter - account name

The JSON structure that should be POSTed (at least one of the fields should be present):

PropertyTypeRequiredDescription
first_name alphabetic string optional The account holder first name (max 45 chars)
last_name alphabetic string optional The account holder last name (max 45 chars)
email email optional The account holder email (max 150 chars)
lang String optional The account's locale (en, es, ja)

Return:

None

Errors:

ResourceNotExistInvalidInput

Example:
POST /accounts/update/johnl2@yahoo.com 
{ 
  "email": "johnl2@yahoo.com", 
}

Grant Account with access permission to a Site

You will use this to grant site access to a sub-user account. Both the site and account must be created before granting end user access. As soon as you grant access, the end-user will have access to site in their dashboard or by logging them in with SSO. You can give multiple accounts access to one site or one account access to multiple sites.

POST /accounts/grant-access/{account_name}/sites/{siteName}

Parameters:

account_name - url parameter - Account name

site_name - url parameter - Site name

Return:

None

Errors:

ResourceNotExistInvalidInput

Example:
POST /accounts/grant-access/johnl2@yahoo.com/sites/de6f096c-10e0-47d4-bcde-c685b401f653 

Revoke Account access permission to a Site

You will use this in order to remove access to a site for a certain account. For example, if your custom does not pay you, you might want to revoke their access until they are actively paying you again.

POST /accounts/revoke-access/{account_name}/sites/{siteName}

Parameters:

account_name - url parameter - Account name

site_name - url parameter - Site name

Return:

None

Errors:

ResourceNotExistInvalidInput

Example:
POST /accounts/revoke-access/johnl2@yahoo.com/sites/de6f096c-10e0-47d4-bcde-c685b401f653