Accounts

Overview

An account resource represents a single Staff or Customer account. There are three account types referenced below, master account, Staff account and Customer account. The master account is the DudaPro account that accesses the Duda API. 

Resource URIs

  • Generate Single Sign-on Token

    Generate a Token that will grant Sub-accounts access to your white label portal. By calling this API, Duda will return a token that you can be append to the end of your SSO Endpoint in order to authenticate a Sub-account directly into your white label account. To generate a Single Sign-On Token for a specific site, you must first give access to a specific site for the Sub-account you want to access that site.  Duda will return a URL Parameter with a key and a value. Use this key value pair to append the Token on to the SSO Endpoint URL

    For more information about Single Sign-On, please visit this page.

    GET /accounts/sso/{account_name}/token

    Required URI Parameters:

    • account_name - URL Parameter - Account name

    Expected Return:

    HTTP Code: 200 OK

    JSON:

    {  
          "url_parameter" : {  
              "name" : "dm_sso",
              "value" : "2|eyJyZXFVdWlkIjoiYTZjMGRjNGU0MTZiNDdiM2FmZGIyNTkzOGYxMjk4ODYifQ"
              }
          }

    Possible Errors:

    ResourceNotExist

    CURL Example:

    curl -S -u 'APIusername:APIpassword' -H 'Content-Type: application/json' -X GET -i -k https://api.dudamobile.com/api/accounts/sso/johnsmith@gmail.com/token​
  • Get Available Multiscreen Site Permissions

    Get a list of available permissions for a Customer account when granting access to a multiscreen website. This list will be updated in the future as new features are released, so it is best to check regularly for updates. 

    GET /accounts/permissions/multiscreen

    Expected Return:

    Http Status Code: 200

    JSON:

    {
              "permissions": [ "PUBLISH", "DEV_MODE", "STATS_TAB", "EDIT", "REPUBLISH", "CUSTOM_DOMAIN", "PUSH_NOTIFICATIONS", "BLOG", "SEO", "RESET", "LIMITED_EDITING", "INSITE", "BACKUPS", "E_COMMERCE"
    ]
          }

    Possible Errors:

    AccessForbidden

    CURL Example:

    curl -S -u 'APIusername:APIpassword' -H 'Content-Type: application/json' -X GET -i -k https://api.dudamobile.com/api/accounts/permissions/multiscreen
  • Get Available Mobile Site Permissions

    Get a list of available permissions for a Customer account when granting access to a mobile website. This list will be updated in the future as new features are released, so it is best to check regularly for updates.

    GET /accounts/permissions/mobile

    Expected Return:

    Http Status Code: 200

    JSON:

    {
            "permissions":["STATS_TAB","EDIT","PUBLISH","DM_DEV_MODE","REPUBLISH","STATS_EMAIL","SEO","CUSTOM_DOMAIN","BACKUPS"]
            }
            

    Possible Errors:

    AccessForbidden

    CURL Example:

    curl -S -u 'APIusername:APIpassword' -H 'Content-Type: application/json' -X GET -i -k https://api.dudamobile.com/api/accounts/permissions/mobile
  • Grant Customer Access to a Site

    Give a Customer account access to a a specific site. This will allow them to access the site inside their account. Both site and account resources must exist already. You may pass an optional JSON permissions object that gives the customer access only to certain features. If no permissions object is passed, the customer will be given access to all features by default.

    When giving customers access to a site, it is important to note that some permissions are dependent on other permissions being present. For example, you cannot give a customer access to a site's SEO if they do not have permission to edit the site first. See below for which permissions are dependent on others for each site type.

    If you would like to update the permissions that a specific customer has to a site, you can call the same API to overwrite any existing permissions.

    Multiscreen Permissions:

    Permission Name Dependency Description of Permission
    STATS_TAB (None) Access to statistics for this site. 
    EDIT (None) Add elements, manage pages, edit design, control site settings.
    DEV_MODE EDIT Directly access HTML/CSS of the site.
    INSITE EDIT Add, edit and delete inSites.
    E_COMMERCE (None) Manage catalogue, view orders and control store settings.
    SEO EDIT Configure SEO settings on a site or page level.
    CUSTOM_DOMAIN EDIT Edit the site's domain.
    BLOG (None) Allow the user to edit or write blog posts.
    REPUBLISH EDIT Update the live site with all changes made in the editor.
    PUBLISH REPUBLISH Publish the site for the first time. Note: When publishing a site for the first time, the account will be automatically charged.
    BACKUPS EDIT Create, restore and delete backups.
    RESET EDIT Reset a site, will allow the customer to pick a new template for the site as part of resetting.
    PUSH_NOTIFICATION EDIT Ability to send push notifications to visitors who have subscribed to notifications on the website.
    LIMITED_EDITING (None) Allow the customer to only edit widget content already in the site. They cannot move, delete or add widgets or change the design. 

    Mobile Permissions:

    Permission Name Dependency Description of Permission
    STATS_TAB (None) Access to statistics for this  site. 
    EDIT (None) Add elements, manage pages, edit design, control site settings.
    HTML_CSS EDIT Directly access HTML/CSS of the site.
    SEO EDIT Configure SEO settings on a site or page level.
    CUSTOM_DOMAIN EDIT Edit the site's domain.
    REPUBLISH EDIT Update the live site with all changes made in the editor.
    PUBLISH REPUBLISH Publish the site for the first time. Note: When publishing a site for the first time, the account will be automatically charged.
    BACKUPS EDIT Create, restore and delete backups.
    POST /accounts/{account_name}/sites/{site_name}/permissions

    URI Parameters:

    • account_name - An existing Duda account that exists under your account
    • site_name - An existing site. Can be a multiscreen or mobile site

    Data structure (body)

    If you have specific permissions you want this customer to have access to, pass a permissions object with an array of specific permission strings.

    JSON example:

    {
              "permissions": ["EDIT", "DEV_MODE", "STATS_TAB"]
          }

    Expected Return:

    Http Status Code: 204 No Content

    Possible Errors:

    AccessForbidden
    ResourceNotExist
    ResourceAlreadyExist
    InvalidInput

    CURL Example:

    curl -S -u 'APIusername:APIpassword' -H 'Content-Type: application/json' -X POST -i -k https://api.dudamobile.comhttps://api.dudamobile.com/api/accounts/johnsmith@gmail.com/sites/146856ab/permissions -d '{"permissions":["EDIT","DEV_MODE","STATS_TAB"]}'
  • Get Site Permissions for a Customer

    Get the permissions that a customer has been granted for a specific site. Each site that a customer is granted access to can have different permissions, so each association can potentially have different permissions. Permissions can be returned for either mobile or multiscreen websites. 

    GET /accounts/{account_name}/sites/{site_name}/permissions

    Expected Return:

    Http Status Code: 200

    JSON:

    {
          "permissions":["STATS_TAB","EDIT","PUBLISH","REPUBLISH","STATS_EMAIL","SEO","CUSTOM_DOMAIN","BACKUPS"]
          }
          

    Possible Errors:

    AccessForbidden

    CURL Example:

    curl -S -u 'APIusername:APIpassword' -H 'Content-Type: application/json' -X GET -i -k https://api.dudamobile.com/api/accounts/johnsmith@gmail.com/sites/146856ab/permissions
  • Get Customer Site Access

    See which permissions a customer has access to for a specific site. Can be a mobile or multiscreensite.

    GET /accounts/{account_name}/sites/{site_name}/permissions

    Expected Return:

    HTTP Status Code: 200 OK

    JSON:

    {
              "permissions": ["EDIT", "DEV_MODE", "STATS_TAB"]
          }
          

    Possible Errors:

    AccessForbidden
    ResourceNotExist

    CURL Example:

    curl -S -u 'APIusername:APIpassword' -H 'Content-Type: application/json' -X GET -i -k https://api.dudamobile.com/api/accounts/johnsmith@gmail.com/sites/146856ab/permissions
  • Remove Customer Access to Site

    Remove/delete access that a customer has to a specific mobile or multiscreen site.

    DELETE /accounts/{account_name}/sites/{site_name}/permissions

    URI Parameters:

    • account_name - An existing Duda account that exists under your account
    • site_name - An existing site. Can be a multiscreen or mobile site

    Expected Return:

    HTTP Status Code: 204 No Content

    Possible Errors:

    AccessForbidden
    ResourceNotExist

    CURL Example:

    curl -S -u 'APIusername:APIpassword' -H 'Content-Type: application/json' -X DELETE -i -k https://api.dudamobile.com/api/accounts/johnsmith@gmail.com/sites/146856ab/permissions
  • Get Multiscreen Sites by Account

    Get a list of all multiscreen site_name(s) that have been granted access to a certain Sub-account. This is often used for building a list of sites to be used as a dashboard or for listing all sites the user might have access to. 

    GET /accounts/grant-access/{account_name}/sites/multiscreen

    Required Parameters:

    • account_name - URL parameter - Account name

    Expected Return:

    HTTP Code: 200 No Content
    JSON Array:

    [
          {
          "site_name":"08e5f101"
          },
          {
          "site_name":"a7fa3956"
          },
          {
          "site_name":"u8elal2"
          }
          ]

    Possible Errors:

    ResourceNotExist

    CURL Example:

    curl -S -u 'APIusername:APIpassword' -H 'Content-Type: application/json' -X GET -i -k https://api.dudamobile.com/api/accounts/grant-access/john@johnsmith.com/sites/multiscreen​
  • Get Mobile Sites by Account

    Get a list of all mobile site_name(s) that have been granted access to a certain Sub-account. This is often used for building a list of sites to be used as a dashboard or for listing all sites the user might have access to. 

    GET /accounts/grant-access/{account_name}/sites/mobile

    Required Parameters:

    • account_name - URL parameter - Account name

    Expected Return:

    HTTP Code: 200 No Content
    JSON Array:

    [
              {
              "site_name":"tand381"
              },
              {
              "site_name":"domenicosdeli12"
              },
              {
              "site_name":"techcrunch81"
              }
          ]

    Possible Errors:

    ResourceNotExist

    CURL Example:

    curl -S -u 'APIusername:APIpassword' -H 'Content-Type: application/json' -X GET -i -k https://api.dudamobile.com/api/accounts/grant-access/john@johnsmith.com/sites/mobile​
  • Get Reset Password URL

    In order to allow your users to login directly to the dashboard, they must set up a password. Using the Get Reset Password URL you can generate a URL to allow your users to access their dashboard/editor directly. We recommend emailing the Reset Password link directly to your customers.

    Required Parameters:

    • account_name - URL parameter - Account name

    Expected Return:

    Http Code: 200

    JSON :

    {
          "reset_url" : "http://example.mobilewebsiteserver.com/login/resetpwd?uuid=e4ec7b6f-b77f-47de-aedf-d2383ccb5de2"
          }

    Possible Errors:

    ResourceNotExist

    CURL Example:

    curl -S -u 'APIusername:APIpassword' -H 'Content-Type: application/json' -X POST -i -k https://api.dudamobile.com/api/accounts/reset-password/johnsmith@gmail.com
  • Sign up a Customer or Staff for Recurring Stats Emails

    Sign up customer or staff member for weekly or monthly statistics emails for a specific site. These emails will be automatically delivered by the Duda platform to your users. Monthly emails are sent on the 3rd of each month and weekly emails are sent every Tuesday.

    POST /accounts/{account_name}/sites/{site_name}/stats-email

    Required Parameters:

    • account_name - URL parameter - Account name
    • site_name - URL parameter - A reference to a specific site

    Data structure (body)

    Send a JSON frequency object with a string defining frequency. Can be 'MONTHLY' or 'WEEKLY'

    JSON:

    {
              "frequency":"WEEKLY"
          }
          

    Expected Return:

    HTTP Status Code: 204 No Content

    Possible Errors:

    ResourceNotExist
    AccessForbidden
    ResourceAlreadyExist

    CURL Example:

    curl -S -u 'APIusername:APIpassword' -H 'Content-Type: application/json' -X POST -i -k https://api.dudamobile.com/api/accounts/johnsmith@gmail.com/sites/146856ab/stats-email -d '{"frequency":"WEEKLY"}'
  • Get Stats Email Settings

    Get the status of stats emails for this customer. If a recurring email is already enabled, a JSON object with the frequency will be returned. If no recurring email is enabled, then an error will be returned.

    GET /accounts/{account_name}/sites/{site_name}/stats-email

    Required Parameters:

    • account_name - URL parameter - Account name
    • site_name - URL parameter - A reference to a specific site

    Expected Return:

    HTTP Status Code: 200 OK

    JSON Returned:

    JSON:

    {
              "frequency":"WEEKLY"
          }
          

    Possible Errors:

    ResourceNotExist
    AccessForbidden

    CURL Example:

    curl -S -u 'APIusername:APIpassword' -H 'Content-Type: application/json' -X GET -i -k https://api.dudamobile.com/api/accounts/johnsmith@gmail.com/sites/146856ab/stats-email
  • Update Stats Email Settings

    Update the frequency of how often stats emails will be sent to this customer for this site.

    POST /accounts/{account_name}/sites/{site_name}/stats-email

    Required Parameters:

    • account_name - URL parameter - Account name
    • site_name - URL parameter - A reference to a specific site

    Data structure (body)

    JSON:

    {
              "frequency":"MONTHLY"
          }
          

    Expected Return:

    HTTP Status Code: 204 No Content

    Possible Errors:

    ResourceNotExist
    AccessForbidden

    CURL Example:

    curl -S -u 'APIusername:APIpassword' -H 'Content-Type: application/json' -X POST -i -k https://api.dudamobile.com/api/accounts/johnsmith@gmail.com/sites/146856ab/stats-email -d '{"frequency":"MONTHLY"}'
  • Delete recurring stats emails

    Stop a user from receiving recurring stats emails.

    DELETE /accounts/{account_name}/sites/{site_name}/stats-email

    Required Parameters:

    • account_name - URL parameter - Account name
    • site_name - URL parameter - A reference to a specific site

    Expected Return:

    HTTP Status Code: 204 No Content

    Possible Errors:

    ResourceNotExist
    AccessForbidden

    CURL Example:

    curl -S -u 'APIusername:APIpassword' -H 'Content-Type: application/json' -X DELETE -i -k https://api.dudamobile.com/api/accounts/johnsmith@gmail.com/sites/146856ab/stats-email
  • Grant Account with Access Permission to a Site

    **NOTE: This API is depreciated. Please use the newer Grant Customer Access to Site API instead.

    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/{site_name}

    Required Parameters:

    • account_name - URL parameter - Account name
    • site_name - URL parameter - Site name

    Expected Return:

    HTTP Code: 204 No Content

    Possible Errors:

    ResourceNotExist
    InvalidInput

    CURL Example:

    curl -S -u 'APIusername:APIpassword' -H 'Content-Type: application/json' -X POST -i -k https://api.dudamobile.com/api/accounts/grant-access/johnsmith@gmail.com/sites/1aadcb7c
  • Revoke Account access permission to a Site

    **NOTE: This API is depreciated. Please use the newer Remove Customer Access to Site API instead.

    You will use this in order to remove access to a site for a certain account. For example, if your customer 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}

    Required Parameters:

    • account_name - URL parameter - Account name
    • site_name - URL parameter - Site name

    Expected Return:

    HTTP Code: 204 No Content

×

Priority Phone Support

English phone support is available 18 hours a day,
Monday through Friday, 3am to 9pm (EST).

United States +1 866-776-1550 3am to 9pm (Eastern)
United Kingdom +44 (0)800-011-9071 8am to 2am (London)
France +33 (0)9-75-18-84-74 9am to 3am (Paris)
Israel +972 (0)3-720-8922 10am to 4am (Jerusalem)
Australia +61 (0)2-8880-9166 7pm to 1pm (Sydney)
To schedule a call in French, Portuguese, Hebrew or Russian, please email us at prioritysupport@dudamobile.com
×

Please Log in as a DudaPro

Priority Phone Support is available exclusively to DudaPros. Log in to your DudaPro account now to see our international support numbers.

Log In
Not a DudaPro? Start a free trial now!