NAV Navbar
Duda

Duda REST API Documentation

shell
  • Introduction
  • Responsive sites
  • Account
  • Permission Groups
  • Analytics
  • Custom Widgets
  • Introduction

    Welcome to the Duda API REST Documentation. Here you will find APIs for Multiscreen (Responsive), Analytics and account management. Duda's REST API is designed to be a management API, which means you can integrate Duda's White Labeled resources (Sites, Accounts, etc..) into your own workflows or services. It is not currently designed to manage individual edits to websites.

    The API uses standard RESTful principles to manage resources:

    Authentication

    curl -X GET -i 'https://api.dudamobile.com/api/sites/multiscreen/templates' \
        -H 'Authorization: ZXhhbXBsZVVzZXI6YmUkdHBAc3M=' \ 
        -H 'Content-Type: application/json'
    

    Instead of explicitly setting the Authorization header, you can use the -u 'APIUser:APIPass' command with cURL instead.

    The Duda API uses basic HTTP authentication to authenticate requests and access resources within your account. As part of getting access to the API, you will get a user name and password combination that is specific to your account. This information should be passed as part of every API request you make to the platform. It is also required that you send this in a preemptive fashion.

    To create the HTTP Authorization Header, you should combine your username and password into one string, separated by a colon and then Base64 encode that string. So for example, 'exampleUser:be$tp@ss' combination would result in the header:

    Authorization: ZXhhbXBsZVVzZXI6YmUkdHBAc3M=

    Security

    The Duda REST API is available over HTTPS only to ensure data privacy. Unencrypted HTTP is not supported. As of the current version, the Duda REST API is secured with HTTP Basic Authentication only.

    Duda recommends requiring a TLS connection instead of SSL. The Duda API does not accept SSLv3 connections, due to the POODLE venerability.

    Access

    To access the Duda API, you need to request access through your websites dashboard. This can be found under the 'Account tab' at the top of the dashboard navigation. Once you request access, Duda will need to approve the request, which takes upto 48 hours. You will only receive your password via email. Please keep the API Username and Password safe, as anyone with this information can access your account.

    The Duda API is free for anyone to access and use. You should take note of the payments section as we currently do not offer free ad-supported sites created via the API.

    Endpoints

    Duda's primary endpoint for all production work is:

    https://api.dudamobile.com/api

    The documentation here assumes that you will combine the endpoint with the path of the API method. There are some cases where you might have a different endpoint than the one above, such as working with Duda's sandbox environment or a custom setup that Duda provides, although this is rare.

    Data schema

    All data passed to and from the Duda API will be in JSON representation. We currently only support this format of data transfer.

    Dates

    There are some Duda APIs that return date time values. Duda formates these in standard universal full date/time pattern in the UTC timezone. The format is: yyyy-mm-ddThh:mm:ss. So for example: 2016-11-15T22:55:53 would be November 11th, 2016 at 10:55:53 PM UTC.

    When sending dates to Duda, you can use the full universal format above, or just the YYYY-MM-DD format. If you omit the time, Duda will default that time to the beginning of the day.

    Langauges

    There are some parts of the API where Duda returns real world content to display to users. As part of this, we are able to deliver localized content. Below you will see a full list of languages that the Duda platform (UI) is localized for along with their corresponding language codes.

    Language Language Code
    English en
    Spanish es
    Spanish LATAM es_ar
    German de
    Portuguese pt
    Turkish tr
    English UK en_gb
    Italian it
    Dutch nl
    French fr
    Indonesian id
    Polish pl

    Errors

    Attempt to get site info for a site that does not exist:

    curl -X GET -i 'https://api.dudamobile.com/api/sites/multiscreen/badName' \
        -H 'Authorization: ZXhhbXBsZVVzZXI6YmUkdHBAc3M=' \ 
        -H 'Content-Type: application/json'
    

    Duda responds with a 400 HTTP code and the following body:

    {
      "error_code": "ResourceNotExist",
      "message": "Site with alias 'badName' doesn't exist"
    }
    

    All API methods will respond with one of the following HTTP response codes:

    HTTP Code Description
    200 OK -- Your request was successful and the response body contains a JSON representation
    204 OK - No response. Your request was successful and Duda had no data to return to you
    302 Found - A common redirect response; you can GET the representation at the URI in the Location response header
    400 Bad Request - The data given in the request failed validation. Inspect the response body for details (see Error data structure for details).
    401 Unauthorized - Duda failed to authenticate your request
    404 Not Found -- The specified method / path could not be found
    405 Method Not Allowed -- The GET/POST/DELETE/PUT Method you input is not supported for this path
    500 This usually means there was a problem on Duda's end. Double check to make sure your data sent is correct then reach out to Duda for help.

    When Duda detects an error in your request, we will respond with a 400 (Bad Request) HTTP response and return a JSON error object:

    Property Type Description
    error_code String Code of the error: ResourceNotExist, InvalidInput, or InternalError
    message String A detailed error message of what went wrong

    Responsive sites

    A site instance resource represents a single responsive Duda website. In the documentation below, responsive websites are referred to as multiscreen websites. They are the same thing.

    Create site

    Call the DudaAPI to create a new multiscreen site. This site will be created in the master account associated with the API key you are using. Creating a site will return a unique site name to reference this site resource. Please note that sites created using this call will be set to Business+ status by default, but will not begin charging you until they are published. Please review the Payments and Publishing section for details.

    Method and path

    POST /sites/multiscreen/create

    Arguments

    Full create site JSON representation. Only the template_id is required.

    {
        "template_id": 20012,
        "url": "www.example.com",
        "default_domain_prefix": "sub-domain",
        "lang":"en",
        "site_data": {
            "site_domain": "www.example.com",
            "external_uid": "AD3421",
            "site_business_info": {
                "business_name": "Open Market",
                "phone_number": "4157775577",
                "email": "name@domain.com",
                "address": {
                    "country": "US",
                    "city": "San Francisco",
                    "state": "CA",
                    "street": "1 Market Street",
                    "zip_code": "94111"
                },
                "opentable_info": [
                    {
                        "restaurant_id":"55123",
                        "location":"Downtown",
                        "country":"US"
                    },
                    {
                        "restaurant_id":"55141",
                        "location":"China Town",
                        "country":"US"
                    }
                ]
            },
            "site_alternate_domains":{
                "domains":["www.domain1.com","www.domain1.net","www.domain2.com"],
                "is_redirect":true
            }
        }
    }
    
    Property Type Required Description
    template_id Int Required Template ID of the template you want to base your new Responsive site on. You can see the API to get available templates here.
    url String optional Have Duda import content into the new site based from an existing website. You may use an existing website address or Facebook business page.
    lang String optional Set the language of the website. This controls the default copy (based on the template), widget outputs and other language specific text. See available languages above.
    default_domain_prefix String optional Set the default sub-domain for your site. This controls the .dudaone.com address.
    site_data Object optional JSON object containing additional site data. See below for the options and properties.
    site_alternate_domain Object optional Set alternate domains for the site. The alternate domain values will be redirected to the primary domain (set in the site_data object).

    The description for the site_data object is below:

    Property Type Required Description
    site_domain String optional Set the domain of the site. This will be: www.example.com. This will be used when the site is published. This must be unique inside of the Duda platform.
    external_uid string optional A flexible string you pass to Duda when creating the site, allows you to store your customer's unique value to reference later (45 char max). Note that Duda does not enforce uniqueness here.
    business_site_info Object optional Pass Duda detailed information about this business / website.

    site_business_info object

    Provides structured data about a website or business. Duda will use this information to help populate the website with this data and fill the content library with data. All data fields are optional.

    Property Type Description
    business_name String The name of the business for the site being created
    phone_number String The primary phone number for the business.
    address Object An object containing address details (city, state, zip, etc..)
    opentable_info Object An object containing arrays of possible opentable IDs.

    Address object

    Providing an address helps the site creation process by giving Duda more information about the location of the business. For example, if you provide an address, we will automatically populate a maps element and potentially find other resources online to assist in site creation.

    Property Type Description
    Street String A street level line location (e.g. 123 Main Street)
    State String The state of where the business is located
    Country String The country of where the business is located
    zip_code String The Zip Code or Postal Code of the business

    OpenTable object

    Providing this will create an OpenTable button and help Duda find more information about the website online. This should be an array of JSON objects, as you can provide multiple restaurant_id's while creating the site.

    Property Type Description
    restaurant_id String The unique OpenTable Restaurant ID. (e.g. 55123)
    location String A description of the location (e.g. Downtown)
    country String Two-digit country location (e.g. US, DE, JA)

    Site_alternate_domain object

    Allows you to define alternate or secondary domains associated with this site. By default, these domains will be 301 redirected to the primary domain. If you change the is_redirect value to false, the alternate domains will resolve the website instead of performing the redirect. Each alternate domain will need to have its DNS settings configured the same way as the primary domain, read here for how to set these up.

    Property Type Required Description
    domains Array optional An array of strings that contain fully qualified domain names. Each domain will be set to redirect to the primary domain of the site.
    is_redirect bool optional Defaults to true. If set as true, all alternate domains will be set to 301 redirect to the primary domain.

    Create a website:

    curl -X POST -i https://api.dudamobile.com/api/sites/multiscreen/create \
        -u 'APIusername:APIpassword' \
        -H 'Content-Type: application/json' \
        -d '{ "template_id": "20012"}'
    

    Expected return:

    {
        "site_name":"28e1182c"
    }
    

    Return

    Upon successful creation of a website, Duda will return a site_name value along with a 200 OK HTTP response. The site_name is a unique string (usually between 8 and 32 characters) across all Duda websites and will be needed to later access other resources, such as updating the site, getting analytics or granting access. We recommend storing this site_name in your database for later reference.

    Get site

    Get information about an already existing website. You will need the site_name value that was provided during the create website call.

    GET /sites/multiscreen/{site_name}

    Required URI Parameters

    site_name - URL Parameter. Originally returned when first creating a website.

    Response JSON from GET Site:

    {
      "account_name": "example@domain.com",
      "external_uid": "externalReference1",
      "site_domain": "customDomain1.com",
      "lang":"en"
      "site_business_info": {
        "business_name": "Example Business",
        "address": {
          "street": "1240 Main ST.",
          "city": "San Francisco",
          "state": "CA",
          "country": "United States",
          "zip_code": "94122"
        },
        "phone_number": "(415) 123-1234",
        "email": "example@domain.com",
        "opentable_info": []
      },
      "site_alternate_domains": {
        "domains": [
          "example1.com","example2.net"
        ],
        "is_redirect": true
      },
      "site_name": "6c56394c",
      "template_id": 20022,
      "site_default_domain": "exampleBusiness.multiscreensite.com",
      "preview_site_url": "http://websitebuilder.websitebusiness.com/preview/6c56394c",
      "last_published_date": "2016-11-15T22:55:53",
      "first_published_date": "2016-04-03T04:36:54",
      "last_reset_by": "ex@dudamobile.com",
      "force_https": false,
      "certificate_status": "COMPLETE",
      "publish_status": "PUBLISHED"
    }
    

    Properties

    Property Type Description
    template_id String The current template_id of the template in use on the site
    site_domain String The primary domain currently assigned to the site
    site_default_domain String Will return the default sub-domain of the site. This value will look like: .dudaone.com or .mutliscreensite.com (partners only). This will be returned even if the site is not published, the site is only accessible on this domain if it is published
    site_name String The unique site name of the site, should be the same as the site_name returned during the creation of the site
    account_name String The name (usually an email address) of the account that owns the site
    preview_site_url String A direct URL to a the three-screen preview of the website in its current state while in design. This white labeled URL non-authenticated and can be accessed by anyone online
    last_published_date date time The date of the most recent publication of the website.
    first_published_date date time The date of when this website was first published. Note that if you unpublished the website and republish it, the first_published_date will not change
    publish_status String The current status of the website. There are three possible values. (1) PUBLISHED: The website is live, published and being paid for. (2) UNPUBLISHED: The website was once published, but is now canceled and not available online. (3) NOT_YET_PUBLISHED: Means the site has never been published before
    business_site_info Object See above (in the create site section) for details of the business_info returned. Duda will only return data that it has about the site
    external_uid String Optional placeholder to be used to reference/link the created Site to some unique identifier origin from external system
    force_https Bool If the website is redirecting all traffic to a secure (HTTPS) connection. If true, all traffic is sent to a secure connection
    last_reset_by String The account name that has most recently reset the website.
    cetrtificate_status String The status of SSL certificate generation. Has three possible values: "COMPLETE", "IN PROGRESS", or "FAILED"
    site_alternate_domains Object See the section above to get the full reference for the site_alternate_domain object.
    curl -X GET https://api.dudamobile.com/api/sites/multiscreen/57b6506a \
        -u 'APIpassword:APIusername' \
        -H 'Content-Type: application/json' 
    

    Get sites by external id

    This will return a list of all site ID's that have the external ID value provided when creating or updating the website. The external ID value is not a unique value in the Duda system -- so multiple sites can have the same external ID value.

    GET /sites/multiscreen/byexternalid/{external_uid}

    Parameters

    Return

    Duda will return an array of site_names for each website that has the matching external ID value.

    You should expect a 200 HTTP response code with the array of site names in the body of the response.

    Example return:

    [
      "6c56394c",
      "e714b0ba"
    ]
    

    Update site

    You can use this call to update properties about a site that is already created. The most common use for this would be to update the site_domain of an already created site. Please note that only values listed here can be updated. Not all values in the get site info can be updated.

    Method and Path

    POST /sites/multiscreen/update/{site_name}

    Required Parameters

    Example JSON to send:

    {
        "site_domain":"example.com",
        "default_domain_prefix":"new-domain-prefix",
        "external_uid":"5123161232",
        "lang":"en",
        "site_alternate_domains":{
            "domains":[
                "alternatedomain1.com",
                "alternatedomain1.net"
            ],
        "is_redirect":true
        }
    }
    

    Parameters to send

    Property Type Description
    site_domain String (FQDN) The domain of the site you want to use. Note that the domain value is unique across the entire Duda system.
    default_domain_prefix String Change the sub-domain prefix that you want to use. This must be a unique value and not used on other sites.
    external_uid String Placeholder for external system identifier. (max 45 chars)
    lang String Set the language of then website. This is used to change the output of default strings in widgets, cookie notifications, etc..
    site_alternate_domains Object Set alternate domains for the site. The alternate domain values will be redirected to the primary domain.
    force_https bool If true, all website traffic will be redirected to a secure (HTTPS) enabled site. Only can be set if an SSL certificate is successfully generated. Defaults to true.

    Example CURL to Update Site:

    curl -X POST -k 'https://api.dudamobile.com/api/sites/multiscreen/update/57b6506a' \
        -u 'APIusername:APIpassword' \ 
        -H 'Content-Type: application/json' \
        -d '{"site_domain":"www.uniquedomain.com"}'
    

    Return

    A 204 No Content HTTP code will be returned upon successful call.

    Delete site

    This will immediately and permanently delete the site and cancel any subscription associated with the site. Please note that after deleting a site there is no way to bring the site back. Deleting a site will also cancel any active subscription/payment associated with the site.

    Method and path

    DELETE /sites/multiscreen/{site_name}

    Parameters

    CURL Example to delete a site:

    curl -X DELETE -k 'https://api.dudamobile.com/api/sites/multiscreen/57b6506a' \
        -u 'APIusername:APIpassword' \ 
        -H 'Content-Type: application/json' 
    

    Return

    Duda will return a 204 No Content HTTP code for successful calls.

    Publish site

    Takes the development version of the site and copies it to a live state. Publishing a site for the first time will also charge your account and create a new subscription unless you have included the test parameter. You can publish a site at any time, which will overwrite the current published version of the site with the current development version.

    Method and path

    POST /sites/multiscreen/publish/{site_name}

    Parameters

    CURL Example:

    curl -X POST -k 'https://api.dudamobile.com/api/sites/multiscreen/publish/57b6506a' \
        -u 'APIusername:APIpassword' \ 
        -H 'Content-Type: application/json' 
    

    Return

    Duda will return a 204 No Content HTTP code for successful calls.

    Unpublish site

    Removes the site from the production environment. This is good for disabling the site or taking it down temporarily so no one can access it. This will not delete the website. The website will still exist and can be published later.

    Method and path

    POST /sites/multiscreen/unpublish/{site_name}

    Parameters

    CURL Example:

    curl -X POST -k 'https://api.dudamobile.com/api/sites/multiscreen/publish/57b6506a' \
        -u 'APIusername:APIpassword' \ 
        -H 'Content-Type: application/json' 
    

    Return

    Duda will return a 204 No Content HTTP code for successful calls.

    Duplicate site

    Create a duplicate of a single multiscreen site. The new site will not be published and/or will lose the site_domain value provided to the previous site. Any customizations done on the site, within the website builder, will be copied to the new version of the site.

    Method and path

    POST /sites/multiscreen/duplicate/{site_name}

    CURL Example:

    curl -X POST -k 'https://api.dudamobile.com/api/sites/multiscreen/duplicate/57b6506a' \
        -u 'APIusername:APIpassword' \ 
        -H 'Content-Type: application/json' \ 
        -d '{"new_default_domain_prefix":"bobspizza"}'
    

    Parameters

    The following parameters can be sent in the body for the new website that will be created. They are all optional

    Property Type Description
    new_default_domain_prefix String If the data set is included, it will set the default prefix domain of the newly duplicated site. For example, if you send bobspizza, the default domain will be: bobspizza.dudaone.com (or bobspizza.multiscreensite.com for partners). This must be a unique value across the system.
    new_external_uid String Specify a new external_uid (external user id) to the site when duplicating it.

    Return

    Duda will respond with a 200 OK HTTP status and return a new site_name.

    {
        "site_name":"a6119858"
    }
    

    Reset site

    Reset and choose a new template for this site. This allows you to keep an existing site_name -- but perform a reset on the site via API.

    Method and Path

    POST /sites/multiscreen/reset/{site_name}

    Parameters

    Example of additional input:

    {
      "template_id": "20001",
      "site_data": {
        "removeBizInfos": true
      }
    }
    

    Input Arguments

    As part of the body request, you can pass any data that is available in the standard create website API call. There is one additional option you can pass to Duda as part of the create site JSON:

    Property Type Required Description
    removeBizInfos Bool Optional If passed as true, resetting the site will remove all business information that exists within the content library. By default, Duda keeps business information in the content library when resetting the website.

    Return

    You can expect a 204 No Content response code for a successful reset call.

    Get sites created between

    Will return an array of site names created during the given time period. If no from parameter is specified, sites created in the past 7 days will be returned. Will return an array of site names. Please see the section about handling dates, above.

    Method and path

    GET /sites/multiscreen/created?from=2016-03-01&to=2016-03-31

    JSON Return:

    [
       "c27cdebf",
       "1aadcb7c",
       "0c2b5c42",
       "83729462",
       "287185af",
       "ff82ddc4",
       "a6119858",
       "57b6506a",
       "5876c248",
       "6f45aed8"
    ]
    

    URL Query Parameters

    Query String Type Required Description
    from Date Optional Start date to query sites for. If not supllied, defaults to 7 days ago, from the current time.
    to Date Optional End date of when to search for. If not supplied, will default to today.

    CURL Example:

    curl -X POST -k 'https://api.dudamobile.com/api/sites/multiscreen/created?from=2016-03-01&to=2016-03-09' \
        -u 'APIusername:APIpassword' \ 
        -H 'Content-Type: application/json' 
    

    Return

    You can expect a 200 OK HTTP code along with an array of site names to be returned for the specified time frame.

    Get multiple sites

    Get site details for many sites at once. You can send an array of site names you can retrieve information about multiple sites at once. This is much quicker than calling the retrieve site multiple times. A maximum of 50 sites can be retrieved at once.

    CURL Example:

    curl -X POST -k 'https://api.dudamobile.com/api/sites/multiscreen/get-many' \
        -u 'APIusername:APIpassword' \ 
        -H 'Content-Type: application/json' \
        -d '[{"site_name":"fb8b8ced"},{"site_name":"76ed3209"}]'
    

    Method and path

    POST /sites/multiscreen/get-many

    Parameters

    An array of site name strings should be sent in the body of the request.

    Return

    JSON Return Example:

    {
      "sites": [
        {
          "account_name": "example@domain.com",
          "site_domain": "example12.com",
          "site_name": "76ed3209",
          "template_id": 20022,
          "site_default_domain": "russ12.dudaone.com",
          "preview_site_url": "http://websitebuilder.company.com/preview/76ed3209",
          "last_published_date": "2015-10-23T17:52:14",
          "first_published_date": "2014-06-24T17:13:42",
          "force_https": false,
          "publish_status": "PUBLISHED"
        },
        {
          "account_name": "example@domain.com",
          "site_domain": "example3.com",
          "site_business_info": {
            "business_name": "Pacific Coast Well Drilling",
            "address": {
              "street": "75 N Main St",
              "city": "Templeton",
              "state": "CA",
              "country": "United States",
              "zip_code": "93465-5101"
            },
            "phone_number": "(805) 434-3121",
            "email": "Example@domain.com",
            "opentable_info": []
          },
          "site_name": "fb8b8ced",
          "template_id": 20012,
          "site_default_domain": "russ257.multiscreensite.com",
          "preview_site_url": "http://websitebuilder.company.com/preview/fb8b8ced",
          "last_published_date": "2016-07-05T19:17:17",
          "first_published_date": "2015-08-10T01:02:16",
          "force_https": true,
          "certificate_status": "COMPLETE",
          "publish_status": "PUBLISHED"
        }
      ]
    }
    

    Duda will return a sites object with an array of sites. The details of the site values returned will be the exact same as the get site example above, please see there for details about values returned.

    You can expect a 200 OK response code.

    Get all templates

    Get an array of objects for all templates available to your account. Each template has a set of data associated with it, including the template_id, which is required to create new sites from. Both Duda default templates and custom templates that you create will be returned by this API call.

    Method and path

    GET /sites/multiscreen/templates

    Example of returned template data:

    [
        {
            "template_name": "Yellow Brick Road",
            "preview_url": "http://example.mobilewebsiteserver.c...heme-20004-263",
            "thumbnail_url": "https://dd-cdn.multiscreensite.com/t...brick-road.jpg",
            "template_id": 20004,
            "template_properties": {
                "can_build_from_url": true
            }
        },
        {
            "template_name": "Popsicle",
            "preview_url": "http://example.mobilewebsiteserver.c...heme-20002-263",
            "thumbnail_url": "https://dd-cdn.multiscreensite.com/t...w/popsicle.jpg",
            "template_id": 20002,
            "template_properties": {
                "can_build_from_url": true
            }
        },
        {
            "template_name": "Medical",
            "preview_url": "http://example.mobilewebsiteserver.c...heme-20021-263",
            "thumbnail_url": "https://dd-cdn.multiscreensite.com/t...ew/medical.jpg",
            "template_id": 20021,
            "template_properties": {
                "can_build_from_url": true
            }
        },
        {
            "template_name": "Custom2 Template",
            "preview_url": "http://example.mobilewebsiteserver.c...eview/f8b71a68",
            "thumbnail_url": "https://dp-cdn.multiscreensite.com/t...nd=[B@676f0be9",
            "template_id": 1000410,
            "template_properties": {
                "can_build_from_url": false
            }
        }
    ]
    

    Optional URI Parameter

    You can add a ?lang=en URL parameter onto the template API path call to get the templates for specific languages. You can see the languages available via the API here.

    Properties

    Property Type Description
    template_name String The name of the template.
    preview_url URL String A direct URL to preview the template. This URL is publically available and does not require authentication.
    thumbnail_url URL String A direct URL to a JPG image displaying the template. This would be good to use to show in a template selection page.
    template_id Int A unique number associated with this template. This is used to create the template from.
    template_properties Object Contains proprieties of the templates. Currently this only contains can_build_from_url
    can_build_from_url Bool Will be either true or false. If it is false, this means that the template is a custom template which cannot pull content from an external URL while creating the site.

    CURL Example to Get All Templates:

    curl -X GET -k 'https://api.dudamobile.com/api/sites/multiscreen/templates' \
        -u 'APIusername:APIpassword' \ 
        -H 'Content-Type: application/json'
    

    Return

    You can expect a 200 OK response along with the all the template data (in an array of objects) shown here.

    Get template info

    Get the name, preview URL, thumbnail_url, and template ID of a single template. You can use this to get particular images or preview URLs of templates to display to your users. This will allow them to see the variety of templates to choose from. If you want to see the full list of template ID's available, please use the get all templates call.

    JSON Data Returned:

    {
        "template_name": "Italiano",
        "preview_url": "http://example.mobilewebsiteserver.com/preview/dm-theme-20012-263",
        "thumbnail_url": "https://dd-cdn.multiscreensite.com/themes-panel/preview/italiano.jpg",
        "template_id": 20012,
        "template_properties": {
            "can_build_from_url": true
        }
    }
    

    Method and path

    GET /sites/multiscreen/templates/{template_id}

    Parameters:

    Optional URI Parameter

    You can add a ?lang=en URL parameter onto the template API path call to get the templates for specific languages. You can see the languages available via the API here

    CURL Example:

    curl -X GET -k 'https://api.dudamobile.com/api/sites/multiscreen/templates/20012' \
        -u 'APIusername:APIpassword' \ 
        -H 'Content-Type: application/json'
    

    Return

    You can expect a 200 OK response along with an JSON object that describes the given template.

    Create template from site

    Take an existing website and turn it into a template. This template can then be used to build new sites from. The template will be returned as part of the GET TEMPLATES api call and be available to select from while creating a new site (under the My Templates section while creating a new multiscreen site).

    Method and path

    POST /sites/multiscreen/template/fromsite

    Example JSON to send:

    {
        "site_name": "66cbb9b7",
        "new_template_name": "Example Template"
    }
    

    Parameters

    Send the following parameters when creating a new template:

    Property Type Required Description
    site_name String Required A valid site name of an existing website. Originally returned after creating the website.
    new_template_name String Required A name for the template you are creating.

    Example to create template:

    curl -X POST -k 'https://api.dudamobile.com/api/sites/multiscreen/template/fromsite' \
        -u 'APIusername:APIpassword' \ 
        -H 'Content-Type: application/json' \ 
        -d '{"site_name": "66cbb9b7","new_template_name": "Example Template"}'
    

    Response:

    You can expect a 200 OK response code alongside a template object that describes the new template.

    JSON Return:

    {
        "template_name": "Example Template",
        "preview_url": "http://example.mobilewebsiteserver.c...eview/365dd849",
        "thumbnail_url": "https://dp-cdn.multiscreensite.com/t...nd=[B@311b938d",
        "template_id": 1000408,
        "template_properties": {
            "can_build_from_url": false
        }
    }
    

    Create template from template

    Take an existing template and turn it into a new template. This template can then be used to build new sites from. The template will be returned as part of the GET TEMPLATES api call and be available to select from while creating a new site (under the My Templates section while creating a new multiscreen site).

    Method and path

    POST /sites/multiscreen/template/fromtemplate

    Example JSON to send:

    {
        "template_id": 1000410,
        "new_template_name": "Example Template"
    }
    

    Parameters

    Send the following parameters when creating a new template:

    Property Type Required Description
    template_id Int Required An ID of an already existing website template.
    new_template_name String Required A name for the template you are creating.

    Example to create template:

    curl -X POST -k 'https://api.dudamobile.com/api/sites/multiscreen/template/fromtemplate' \
        -u 'APIusername:APIpassword' \ 
        -H 'Content-Type: application/json' \ 
        -d '{"template_id":20012,"new_template_name": "Example Template"}'
    

    Response:

    You can expect a 200 OK response code alongside a template object that describes the new template.

    JSON Return:

    {
        "template_name": "Example Template",
        "preview_url": "http://example.mobilewebsiteserver.c...eview/365dd849",
        "thumbnail_url": "https://dp-cdn.multiscreensite.com/t...nd=[B@311b938d",
        "template_id": 1000410,
        "template_properties": {
            "can_build_from_url": false
        }
    }
    

    Delete custom template

    Delete a previously created custom template. This will not delete any sites that have been created from the template, but it will remove it from your list of available templates.

    Method and path

    DELETE /sites/multiscreen/templates/{template_id}

    URI Parameters:

    curl -X DELETE -k 'https://api.dudamobile.com/api/sites/multiscreen/template/100041' \
        -u 'APIusername:APIpassword' \ 
        -H 'Content-Type: application/json'
    

    Response

    Upon successful deletion, a 204 No Content HTTP code will be returned.

    Update custom template

    Update the name of an existing custom template.

    Example JSON to send:

    {
        "new_name": "New template name"
    }
    

    Method and path

    POST /sites/multiscreen/templates/{template_id}

    URI Parameters

    curl -X POST -k 'https://api.dudamobile.com/api/sites/multiscreen/template/100041' \
        -u 'APIusername:APIpassword' \ 
        -H 'Content-Type: application/json' \
        -d '{"new_name":"New template name"}'
    

    Return

    Upon successful update a 204 No Content HTTP response code will be returned.

    Get pages

    Get all pages that exist within the website. Returns an array of objects that describes each page of the site.

    Method and path

    GET /api/sites/multiscreen/site/{site_name}/pages

    CURL Example:

    curl -X GET -k 'https://api.dudamobile.com/api/sites/multiscreen/site/b4ra2g/pages' \
        -u 'APIusername:APIpassword' \ 
        -H 'Content-Type: application/json'
    

    JSON Representation:

    [
      {
        "page_title": "ABOUT",
        "page_path": "about/abab",
        "page_name": "YWJvdXQvYWJhYg"
      },
      {
        "page_title": "SERVICES",
        "page_path": "services",
        "page_name": "c2VydmljZXM"
      },
      {
        "page_title": "HOME",
        "page_path": "home",
        "page_name": "aG9tZQ"
      },
      {
        "page_title": "CONTACT",
        "page_path": "contact",
        "page_name": "Y29udGFjdA"
      }
    ]
    

    Properties required

    Properties returned

    Property Type Description
    page_name String The internal unique name of the specific page. This value is used to update or delete the page with other API calls. Note that this is updated when the path of the page is changed.
    page_title String The title of the page in the navigation of the site and also in the pages menu.
    page_path String The path / URL to this page on the website.

    Return

    You can expect a 200 OK response code with an array of JSON objects describing each page.

    Update page

    Update an existing page on the website. You can update either the page_title or the page_path of a specific page. You need to pass the page_name to update it, which is returned via the GET Pages API Call.

    Method and path

    POST /api/sites/multiscreen/site/{site_name}/pages/{page_name}/update

    Required Properties

    Example:

    curl -X POST -k 'https://api.dudamobile.com/api/sites/b4ra2g/pages/Y29udGFjdA/update' \
        -u 'APIusername:APIpassword' \ 
        -H 'Content-Type: application/json' \ 
        -d '{ "page_path":"contact/1","page_title":"contact 1"}'
    

    Return

    You can expect a 204 No Content HTTP response for a successful call.

    Get page

    Get the details of an individual page of the site. Returns a JSON object containing the page_title, page_path and unique page_name.

    Example

    curl -X GET -k 'https://api.dudamobile.com/api/sites/b4ra2g/pages/YWJvdXQvYWJhYg' \
        -u 'APIusername:APIpassword' \ 
        -H 'Content-Type: application/json'
    

    Method and path

    GET /api/sites/multiscreen/site/{site_name}/pages/{page_name}

    JSON Return

    {
      "page_title": "ABOUT",
      "page_path": "about/abab",
      "page_name": "YWJvdXQvYWJhYg"
    }
    

    Required URI inputs

    Return

    You can expect a 200 OK response HTTP code for a successful call.

    Delete page

    Delete a page of your website. This cannot be undone.

    Example

    curl -X DELETE -k 'https://api.dudamobile.com/api/sites/b4ra2g/pages/YWJvdXQvYWJhYg' \
        -u 'APIusername:APIpassword' \ 
        -H 'Content-Type: application/json'
    

    Method and path

    DELETE /api/sites/multiscreen/site/{site_name}/pages/{page_name}/delete

    Required URI Inputs

    Return

    You can expect a 204 No Content HTTP code upon success.

    Inject content

    Basic structure of inject content data

    [
      {
        "type": "INNERHTML",
        "key": "dataInjectValueToSearchFor",
        "value": "valueToReplaceContentWith"
      },
      {
        "type": "DOMATTR",
        "key": "dataInjectValueToSearchFor",
        "value": "attributeValueToAddToRefs",
        "refs": [
          "placeholderKeyToAddOrRepace1","placeholderKeyToAddOrRepace2"
        ]
      },
      {
        "type": "CSS",
        "key": "dataInjectValueToSearchFor",
        "value": "cssValueToAddToBlock:rgba(0,0,0,1)",
        "refs": [
          "cssPropertiesToAddOrReplace1","background-color","background"
        ]
      }
    ]
    

    Content injection allows you to change a website via API (text, images, CSS, etc..) direclty on an existing website or template. You can update CSS values, InnerHTML of an elemnt or an attribute on an element. For the InnerHTML and Attr types, you must have the data-inject=value set on the element. For the CSS type, you must have a data-inject:value CSS property set within a declaration block.

    This feature primarily works by sending the type value to alter the markup or styling in multiple ways. Should pass Duda an array of JSON objects. For a full example of content injection, please see this guide.

    Method and path

    POST /api/sites/multiscreen/inject-content/{siteName}

    Types of injection

    Below you will see the three types of injection available: CSS, DOMATTR, and INNERHTML along with how Duda expects each one to be sent.

    Example

    # If you have this HTML & CSS block within the website:
    #
    # <a class="u_1454453128 dmNewParagraph email-css" data-inject="email" id="1454453128" href="mailto:oldEmail@domain.com">oldEmail@domain.com</a>
    #
    # .email-css {
    #   data-inject: email-css;
    #   color: #474747;
    # }
    #
    # And run this: 
    curl -X POST -k 'https://api.dudamobile.com/api/sites/multiscreen/inject-content/b4ra2g' \
        -u 'APIusername:APIpassword' \ 
        -H 'Content-Type: application/json' \
        -d '[
                {
                    "type": "INNERHTML",
                    "key": "email",
                    "value": "newEmail@domain.com"
                },
                {
                    "type": "DOMATTR",
                    "key": "email",
                    "value": "mailto:newEmail@domain.com",
                    "refs": [
                        "href"
                    ]
                },
                {
                    "type": "CSS",
                    "key": "email-css",
                    "value": "#000000",
                    "refs": [
                        "color"
                    ]
                }
            ]'
    # The code will be updated to:
    # <a class="u_1454453128 dmNewParagraph email-css" data-inject="email" id="1454453128" href="mailto:newEmail@domain.com">newEmail@domain.com</a>
    #
    # .email-css {
    #   data-inject: email-css;
    #   color: #000000;
    # }
    

    INNERHTML

    Property Type Description
    type String INNERHTML: Replaces all content (HTML, text, etc..) within this element.
    key String The value of the data-inject attribute on the element. For example, if you have data-inject=email you should place email as the value. Duda will then search through every page of the site and replace the innerHTML of all elements that contain the data-inject=email attribute.
    value String The content you want to be placed within the element. Can be static text, HTML, etc.

    DOMATTR

    Property Type Description
    type String DOMATTR: Allows you to add or update the attributes of the element.
    key String The value of the data-inject attribute on the element. For example, if you have data-inject=email you should place email as the value. Duda will then search through every page of the site and add or replace the DOM attributes of all elements that contain the data-inject=email attribute.
    value String The value of the attribute you are wanting to add. For example, if you want to change the src of an image, you would place the direct URL of the image as the value.
    refs Array of Strings The keys of the attributes you want to add or replace. For example, if you want to alter the src of an image, you would place src as a string here.

    CSS

    Property Type Description
    type String CSS: Allows you to add or update CSS values within the block that the CSS value data-inject:name is present.
    key String The value of the data-inject attribute within the CSS block. For example, if you have data-inject:email-css you should place email-css as the value here. Duda will then search through every CSS file of the site and replace the values of the reference strings you pass.
    value String The CSS value you want to update. This could be none for the display property, a URL for background-image or a color code (HEX or RGB) for color values, for example.
    refs Array of Strings The property of the CSS you want to update. This will find the property you pass here and update with the value above.

    Return

    Duda will return a 204 No Content HTTP response code.

    Get Inject Content Values

    Search the website for all references of the data-inject value, either in the HTML or CSS of the website. This returns to you the existing properties that can be used for data injection later.

    This can also be used to get the actual content of a specific element within the website.

    Example 1 of one button within the website that contains a data-inject="read-more-btn" attribute assigned to it:

    curl -u 'APIusername:APIpassword' \  
    -X GET -k 'https://api.dudamobile.com/api/sites/multiscreen/inject-content/b4ra2g' \
    -H 'Content-Type: application/json'
    

    Response 1

    [
      {
        "key": "read-more-btn",
        "type": "DOMATTR",
        "ref": "class",
        "value": "u_1330691906 align-center dmButtonLink dmWidget dmWwr default dmOnlyButton dmDefaultGradient"
      },
      {
        "key": "read-more-btn",
        "type": "DOMATTR",
        "ref": "href",
        "value": "/about"
      },
      {
        "key": "read-more-btn",
        "type": "DOMATTR",
        "ref": "dmle_widget",
        "value": "dudaButtonLinkId"
      },
      {
        "key": "read-more-btn",
        "type": "DOMATTR",
        "ref": "id",
        "value": "1330691906"
      },
      {
        "key": "read-more-btn",
        "type": "DOMATTR",
        "ref": "data-inject",
        "value": "read-more-btn"
      },
      {
        "key": "read-more-btn",
        "type": "INNERHTML",
        "value": "<span class=\"iconBg\" id=\"1206527425\" duda_id=\"1206527425\"> <span class=\"icon hasFontIcon icon-star\" id=\"1686467387\" duda_id=\"1686467387\"> </span></span><span class=\"text\" id=\"1307805474\" localization_key=\"templates.custom.197\" duda_id=\"1307805474\">      Read More     </span>"
      }
    ]
    

    Example 2, filtering for only the INNERHTML:

    curl -u 'APIusername:APIpassword' \  
    -X GET -k 'https://api.dudamobile.com/api/sites/multiscreen/inject-content/b4ra2g?type=INNERHTML' \
    -H 'Content-Type: application/json'
    

    Example 2 response:

    [
      {
        "key": "read-more-btn",
        "type": "INNERHTML",
        "value": "<span class=\"iconBg\" id=\"1206527425\" duda_id=\"1206527425\"> <span class=\"icon hasFontIcon icon-star\" id=\"1686467387\" duda_id=\"1686467387\"> </span></span><span class=\"text\" id=\"1307805474\" localization_key=\"templates.custom.197\" duda_id=\"1307805474\">Read More</span>"
      }
    ]
    

    Method and path

    GET /api/sites/multiscreen/inject-content/{site_name}

    Optional query parameters

    You can append the following query parameters to filter the results of what will be returned:

    Property Type Description
    key String Search for a specific element that contains the data-inject attribute or CSS block that has the data-inject CSS property.
    type String Can be: "DOMATTR", "CSS" or "INNERHTML". Search for only the specific type of response.
    ref String Used with CSS & DOMATTR types. Can filter for a specific value type.

    Return

    You can expect a 200 OK HTTP response code along with an array of json objects describing the inject content possibilities.

    Upload resources

    Upload resources to the website from an external source. Today, this only supports images, but might be extended in the future for other types of media. This will upload the resource to the CDN that Duda uses and make it available to anyone building the website. This API is commonly used in conjunction with the inject content API to insert new images directly into the website.

    Method and path

    POST /api/sites/multiscreen/resources/{site_name}/upload

    Input example:

    [
      {
        "src": "http://www.dudasupport.com/test/beach.jpg",
        "recource_type": "IMAGE"
      },
      {
        "src": "http://www.dudasupport.com/test/field.jpeg",
        "recource_type": "IMAGE"
      }
    ]
    

    Input parameters

    Duda expects an array of JSON objects that contain a source (src) and resource_type attribute.

    Property Type Required Description
    src URL String Required A public URL for the resource. This must be publically available so that Duda can copy it to our CDN / storage associated with the website.
    resource_type String Required The type of resource being uploaded. Today, the only allowed value is IMAGE.

    Example

    curl -X GET -k 'https://api.dudamobile.com/api/sites/multiscreen/published?lastDays=30' \
        -u 'APIusername:APIpassword' \ 
        -H 'Content-Type: application/json' \
        -d '[{"src":"http://www.dudasupport.com/test/beach.jpg","recource_type": "IMAGE"},{"src": "http://www.dudasupport.com/test/field.jpeg","recource_type": "IMAGE"}]'
    

    JSON Return

    {
      "n_failures": 0,
      "uploaded_resources": [
        {
          "original_url": "http://www.dudasupport.com/test/beach.jpg",
          "new_url": "https://irt-cdn.multiscreensite.com/a60fe88591064282a20cdb63a8ca5740/beach.jpg",
          "status": "UPLOADED"
        },
        {
          "original_url": "http://www.dudasupport.com/test/field.jpeg",
          "new_url": "https://irt-cdn.multiscreensite.com/a60fe88591064282a20cdb63a8ca5740/field.jpeg",
          "status": "UPLOADED"
        }
      ]
    }
    

    Return

    Duda will return a 200 OK response code along with the following data:

    Property Type Description
    n_failures int The number of failed resource that failed to upload.
    uploaded_resources Array of Objects An array of objects describing each resource uploaded. This contains an original URL, new URL (in the Duda system) and a status.
    original_url URL String The original URL/soruce of the resource that was uploaded.
    new_url URL String A direct URL link to the resource, uploaded to the website.
    status String The status of the upload. This can be NOT_FOUND if Duda could not access the resource or UPLOADED for a successful upload.

    Get recently published sites

    Get a list of recently published websites in your account, for a specific amount of days. This returns results of all sites that have been published recently, either for an ongoing website update or for the first time. This can be used in conjunction with the get site to see the status of the website for billing reasons. You can call this API to get recently published websites, then get the actual status of the website by calling the get site to see if it is published, unpublished or has never been published.

    If you do not pass a lastDays value, then Duda will return results for the last 7 days by default.

    Method and path

    GET /sites/multiscreen/published

    JSON Response:

    [ 
    "a75b4ddc", 
    "d2f8eded" 
    ]
    

    URI Parameters:

    Response

    Duda will return a 200 OK response code along with an array of strings that are Duda Site_name values.

    CURL Example:

    curl -X GET -k 'https://api.dudamobile.com/api/sites/multiscreen/published?lastDays=30' \
        -u 'APIusername:APIpassword' \ 
        -H 'Content-Type: application/json'
    

    Get recently unpublished sites

    Get a list of recently unpublished websites in your account, for a specific amount of days. This returns results of all sites that have been unpublished recently, which usually means the website was canceled. This can be used in conjunction with the get site to see the status of the website for billing reasons. You can call this API to get recently unpublished websites, then get the actual status of the website by calling the get site to see if it is published or unpublished.

    If you do not pass a lastDays value, then we will return results for the last 7 days by default.

    JSON Response:

    [ 
    "a75b4ddc", 
    "d2f8eded" 
    ]
    

    Method and path

    GET /sites/multiscreen/unpublished

    URI Parameters:

    CURL Example:

    curl -X GET -k 'https://api.dudamobile.com/api/sites/multiscreen/unpublished?lastDays=30' \
        -u 'APIusername:APIpassword' \ 
        -H 'Content-Type: application/json'
    

    Response

    Duda will return a 200 OK response code along with an array of strings that are Duda Site_name values.

    Get contact form data

    Get all the contact form submissions that happened on this site. This call will return an array of each contact form submission.

    Example JSON Response:

    [
       {
          "form_title":"Contact Us",
          "message":{
             "Name":"test3",
             "Phone":"123-123-1234",
             "Dropdown":"Option 2",
             "Email":"test@test.com",
             "Message":"test message",
             "Radio button":"Option 2",
             "Date":"02/05/2014",
             "Check box":"Option 2"
          },
          "date":"2014-05-08T23:12:06"
       },
       {
          "form_title":"Contact Us",
          "message":{
             "Name":"test",
             "Phone":"abcc",
             "Email":"test@test.com",
             "Message":"123"
          },
          "date":"2014-05-08T22:34:50"
       }
    ]
    

    Method and path

    GET /sites/multiscreen/get-forms/{site_name}

    Required Parameters:

    URL Parameters

    You can add on additional to or from URL parameters onto the full URL to decide which date range you would like to get contact form details from. These should be in standard date format.

    curl -X GET -k 'https://api.dudamobile.com/api/sites/multiscreen/get-forms/b4ra2g?from=2017-01-01&to=2017-01-30' \
        -u 'APIusername:APIpassword' \ 
        -H 'Content-Type: application/json'
    

    Generate SSL Certificate

    Generate a SSL certificate for a specific website. This will enable a HTTPS connection between site visitors and the Duda platform. It usually takes 15-30 minutes to successfully generate a SSL certificate for a website. You can get the status of the SSL certificate by calling the GET site API and checking the certificate_status parameter. Once the certificate is successfully generated, all website visitors will be redirected to the HTTPS connection. This can be disabled on by updating the site force_https value to false. You do not need to worry about renewing the certificate, as Duda will do this automatically.

    Method and path

    POST /sites/multiscreen/{site_name}/certificate

    URI Parameter: - site_name

    Return

    Upon success, Duda will return a 204 No Content HTTP code.

    curl -X POST -k 'https://api.dudamobile.com/api/sites/multiscreen/b4ra2g/certificate' \
        -u 'APIusername:APIpassword' \ 
        -H 'Content-Type: application/json'
    

    Delete SSL Certificate

    Delete a certificate that has been generated for a website. This will ensure that the website is served over only an HTTP (insecure) connection and will delete the generated certificate.

    Method and path

    DELETE /sites/multiscreen/{site_name}/certificate

    URI Parameter: - site_name

    Return

    Upon success, Duda will return a 204 No Content HTTP code.

    curl -X DELETE -k 'https://api.dudamobile.com/api/sites/multiscreen/b4ra2g/certificate' \
        -u 'APIusername:APIpassword' \ 
        -H 'Content-Type: application/json'
    

    Create site backup

    Create a new backup of a site. This is used for saving the existing state of a site. Good for saving a restore point before a user starts to edit a site or after work has been completed.

    Method and path

    POST /sites/multiscreen/backups/{site_name}/create

    Parameters

    Example JSON to send:

    {
       "name":"QA-Complete"
    }
    

    Body Parameters

    You can define the name of the backup:

    Property Type Required Description
    name String Optional Set the name of the backup you are creating.

    Example

    curl -X POST -k 'https://api.dudamobile.com/api/sites/multiscreen/backups/b4ra2g' \
        -u 'APIusername:APIpassword' \ 
        -H 'Content-Type: application/json' \
        -d '{"name":"QA-Complete"}''
    

    Returned data:

    {
      "backup_name": "QA-Complete"
    }
    

    Return

    Upon success, Duda will return a 200 OK HTTP response code along with the backup_name of the created backup.

    Get site backups

    Get an array of existing site backups/versions. A backup can be created from inside of the editor (or by API) and is also automatically created every time the site is published.

    Example JSON return:

    [
       {
          "date":"2014-06-07T11:18:51",
          "name":"russ7_Auto_3"
       },
       {
          "date":"2014-06-07T11:19:02",
          "name":"russ7_Auto_4"
       },
       {
          "date":"2014-06-07T11:19:13",
          "name":"russ7_Auto_5"
       },
       {
          "date":"2014-06-07T11:19:21",
          "name":"russ7_Auto_6"
       },
       {
          "date":"2014-06-07T11:29:49",
          "name":"russ7_Auto_7"
       },
       {
          "date":"2014-06-07T11:33:21",
          "name":"ManualBackup_1"
       }
    ]
    

    Method and path

    GET /sites/multiscreen/backups/{site_name}

    URI Parameters:

    CURL Example:

    curl -X GET -k 'https://api.dudamobile.com/api/sites/multiscreen/backups/b4ra2g' \
        -u 'APIusername:APIpassword' \ 
        -H 'Content-Type: application/json'
    

    Return

    Upon successful call, Duda will return a 200 OK response code along with the array of data objects in the body.

    Restore site

    Restore a site from an existing backup. This will fully restore the site back to the state it was in at the time of the backup creation. When restoring a site, a backup is automatically made of the site before restoring the backup. You will be able to see the backup that is created via the Get Site Backups call.

    Method and path

    POST /sites/multiscreen/backups/{site_name}/restore/{backup_name}

    Parameters

    Example:

    curl -X POST -k 'https://api.dudamobile.com/api/sites/multiscreen/backups/b4ra2g/restore/QA-Complete' \
        -u 'APIusername:APIpassword' \ 
        -H 'Content-Type: application/json'
    

    Return

    Upon success, Duda will return a 204 No Content HTTP status code.

    Delete site backup

    Permanently delete a site backup. There is no way to restore or gain access to deleted site backups.

    Method and path

    DELETE /sites/multiscreen/backups/{site_name}/restore/{backup_name}

    Parameters

    Example:

    curl -X DELETE -k 'https://api.dudamobile.com/api/sites/multiscreen/backups/b4ra2g/restore/QA-Complete' \
        -u 'APIusername:APIpassword' \ 
        -H 'Content-Type: application/json'
    

    Return

    Upon success, Duda will return a 204 No Content HTTP status code.

    Account

    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 Duda account that accesses the Duda API.

    Create account

    Create a new Duda account in which you can grant a customer or staff permissions or site access. This generally will relate back to a customer or staff user from your control panel.

    Method and path

    POST /accounts/create

    JSON example to send:

    {
        "account_name": "uniqueAcctReference",
        "first_name": "Joann",
        "last_name": "Smith",
        "lang": "en",
        "email": "example@domain.com",
        "account_type": "CUSTOMER"
    }
    

    cURL Example

    curl -S -u 'APIusername:APIpassword' -H 'Content-Type: application/json' \
    -X POST -i -k https://api.dudamobile.com/api/accounts/create \
    -d '{"account_name":"email@email.com", "first_name":"john", "last_name":"doe", "account_type":"CUSTOMER", "lang":"en"}' 
    

    Parameters:

    Property Type Required Description
    account_name String Required Usually the email or unique identifer of the user you want to add. Is not required to be a email.
    first_name String Optional First name off the account holder. This is only used if Duda sends white labeled emails to the customer or the user writes a blog post.
    last_name String Optional Last name of the account holder. This is used if Duda sends white labeled emails to the customer or the user writes a blog post.
    account_type String Optional Can be "CUSTOMER" or "STAFF". Accounts created are defaulted to customer accounts.
    lang String Optional Two digit language code. Sets what language the user will see the website builder interface in.

    Return

    You can expect a 204 No Content response code for a successful create account call.

    Get account

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

    Method and path

    GET /accounts/{account_name}

    Parameters

    Returned JSON

    {
        "account_name": "johnl2@yahoo.com"
        "first_name": "John",
        "last_name": "Lewis",
        "email": "johnl@yahoo.com",
        "account_type":"CUSTOMER"
    }
    

    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
    

    Return:

    Upon success, Duda will return a 200 OK HTTP status code. A JSON object representing the Account will be returned with the following possible values:

    Property Type Description
    account_name String The account name, usually an email address. This is the unique reference to the account.
    first_name String First name of user.
    last_name String Last name of user.
    email Valid Email Email address of the account. Can be different than account_name
    account_type String Can be "CUSTOMER" or "STAFF". Represents the type of account.
    lang String The current language of the account.

    Delete account

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

    Method and path

    DELETE /accounts/{account_name}

    Example:

    curl -S -u 'APIusername:APIpassword' -H 'Content-Type: application/json' \
    -X DELETE -i -k https://api.dudamobile.com/api/accounts/johnsmith@gmail.com
    

    Parameters:

    Return

    You can expect a 204 No Content response code for a successful delete account call.

    Update account

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

    Method and path

    POST /accounts/update/{account_name}

    cURL Example

    curl -S -u 'APIusername:APIpassword' \
    -H 'Content-Type: application/json' \
    -X POST \
    -k https://api.dudamobile.com/api/accounts/update/johnsmith@gmail.com \
    -d '{"email": "jsmith@gmail.com"}'
    

    Required Parameters:

    You can update any property documented in the create account call on an account when passing data. You must send a valid JSON object to update an account successfully.

    Return

    You can expect a 204 No Content response code for a successful delete account call.

    Generate a Single Sign-On link that will send a user to a specific page in the platform. You can generate a link to: The dashboard, the editor, stats page or to reset a site. If you are sending the user to the stats, editor or reset pages, you will need to pass the site_name and target as a parameter on the request URL. After generating the link, you should direct the users browser to this URL.

    The link you generate will have a valid SSO token appended to it which will be valid for two minutes.

    If you are generating a link to a specific site for a customer, please make sure the customer has been granted access to the site and also has appropriate permissions. For example, if the customer does not have access to statistics, then you will be unable to generate an SSO link to the stats page.

    cURL Example:

    curl -S -u 'APIusername:APIpassword' \ 
    -H 'Content-Type: application/json' \
    -X GET \
    -k https://api.dudamobile.com/api/accounts/sso/johnsmith@gmail.com/link​?target=STATS&site_name=146856ab
    

    Method and path

    GET /accounts/sso/{account_name}/link?target=EDITOR&site_name=h5de912a

    Paramters

    You must send a valid account_name as part of the URI parameter. There are several optional URL query paramters you can add on the request. If you pass the stats, Site Editor or Reset Site targets, you must also add a site_name parameter for the website that you are wanting to give the user access to.

    JSON Response:

    {  
      "url": "http://example.mobilewebsiteserver.com/home/site/146856ab?dm_sso=2!eyJyZXFVdWlkIjoiYzU0Y2E0MzYwNDA2NDgwZDlmZmM2MTIxY2FiOTM2MzAifQ"
    }
    
    Target Location Query Key Query Value Description
    Dashboard (none) (none) Send the user directly to their website dashboard. You do not need to send a target or site_name parameter.
    Stats "TARGET" "STATS" Send the user directly to the website statistics page.
    Site Editor "TARGET" "EDITOR" Send the user directly to the white labeled website builder.
    Stats "TARGET" "RESET_SITE" Send the user directly to the select new template / reset site page. Note that if the user does reset the site, all existing website edits will be lost and the site will be reset to a new template that is selected.

    Generate single sign-on token

    cURL Example

    curl -S -u 'APIusername:APIpassword' \
    -H 'Content-Type: application/json' \
    -X GET \
    -k https://api.dudamobile.com/api/accounts/sso/johnsmith@gmail.com/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.

    Method and path

    GET /accounts/sso/{account_name}/token

    Parameters:

    Return:

    HTTP Code: 200 OK

    JSON Response example:

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

    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 array 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.

    Method and path

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

    Array permissions to send

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

    cURL Example:

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

    Permission options:

    Permission Name Dependency Description
    STATS_TAB (None) Access to the statistics for this website.
    EDIT (None) Allow the user to perform all possible edits to the website, such as delete elements, move them add new content.
    DEV_MODE EDIT Allow direct access to the HTML & CSS of the website. This still allows the user to use the HTML embed widget.
    INSITE EDIT Add, edit, or delete existing website personalization rules.
    E_COMMERCE (None) Manage catalogue, view orders and control store settings.
    SEO EDIT Set SEO settings on the site or page level.
    CUSTOM_DOMAIN EDIT Set or edit the domain of a website. Can only be accessed on published websites.
    BLOG (None) Give access to write new posts, edit existing ones and manage blog settings.
    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 from the website.
    LIMITED_EDITING (None) Allow the customer to only edit widget content already in the website. They cannot move, delete or add widgets or change the design. Note that any permission that has the EDIT requirement cannot be used in conjunction with limited editing.

    Get 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.

    Method and path

    GET /accounts/permissions/multiscreen

    JSON Response:

    [
        "PUBLISH",
        "CUSTOM_DOMAIN",
        "DEV_MODE",
        "E_COMMERCE",
        "REPUBLISH",
        "INSITE",
        "SEO",
        "STATS_TAB",
        "RESET",
        "BACKUPS",
        "BLOG",
        "LIMITED_EDITING",
        "EDIT",
        "PUSH_NOTIFICATIONS"
    ]
    
    curl -S -u 'APIusername:APIpassword' \
    -H 'Content-Type: application/json' \
    -X GET \
    -k https://api.dudamobile.com/api/accounts/permissions/multiscreen
    

    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.

    Method and path

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

    Return

    You can expect a 200 OK response code for a successful call.

    JSON Example

    {
        "permissions": [
            "STATS_TAB",
            "EDIT",
            "PUBLISH",
            "REPUBLISH",
            "STATS_EMAIL",
            "SEO",
            "CUSTOM_DOMAIN",
            "BACKUPS"
        ]
    }
    
    curl -S -u 'APIusername:APIpassword' \
    -H 'Content-Type: application/json' \
    -X GET \
    -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.

    Method and path

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

    curl -S -u 'APIusername:APIpassword' \
    -H 'Content-Type: application/json' \
    -X DELETE \
    -k https://api.dudamobile.com/api/accounts/johnsmith@gmail.com/sites/146856ab/permissions
    

    URI Parameters:

    Return:

    You can expect a 204 No Content response code for a successful delete access call.

    curl -S -u 'APIusername:APIpassword' \
    -H 'Content-Type: application/json' \
    -X DELETE \
    -k https://api.dudamobile.com/api/accounts/johnsmith@gmail.com/sites/146856ab/permissions
    

    Subscribe customer to stats

    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. You can also perform the same API call to overwrite the existing frequency of customers already signed up.

    Example

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

    Method and path

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

    Parameters

    You can also send a JSON object in the body of the request which tells Duda the frequency to send the customers emails: "MONTHLY" or "YEARLY".

    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.

    Method and path

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

    JSON Response

    {
        "frequency":"WEEKLY"
    }
    

    Example

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

    Parameters

    Example

    curl -S -u 'APIusername:APIpassword' \
    -H 'Content-Type: application/json' \
    -X DELETE \
    -k https://api.dudamobile.com/api/accounts/johnsmith@gmail.com/sites/146856ab/stats-email
    

    Response

    You can expect a 200 OK response code for a successful call.

    Unsubscribe customer stats email

    Stop a user from receiving recurring stats emails.

    Method and path

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

    Parameters

    Response

    You can expect a 204 No Content response code for a successful delete call.

    Get multiscreen sites by account

    Get all websites that a specific customer account has access to. This is useful for reporting and also listing a dashboard of websites for an end-user to access/edit.

    JSON Return:

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

    Example

    curl -S -u 'APIusername:APIpassword' \
    -H 'Content-Type: application/json' \
    -X GET \
    -k https://api.dudamobile.com/api/accounts/grant-access/john@johnsmith.com/sites/multiscreen​
    

    Method and path

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

    Parameters:

    Return

    You can expect a 200 OK response back with an array of site name objects for this customer.

    In order to allow your users to log in directly to the white label dashboard, they must set up a password. Using the Get Reset Password URL you can generate a unique URL to allow your users to access their dashboard/editor directly. We recommend emailing the Reset Password link directly to your customers. This URL is only valid for 30 days.

    JSON Return

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

    Example:

    curl -S -u 'APIusername:APIpassword' \
    -H 'Content-Type: application/json' \
    -X POST \
    -k https://api.dudamobile.com/api/accounts/reset-password/johnsmith@gmail.com
    

    Method and path

    POST /accounts/reset-password/{account_name}

    Return

    With a successful call, you should receive a 200 OK status response.

    Permission Groups

    Permission groups are a resource of a DudaPro account. Groups set the exact features that Staff members will have access to. Each group has a set of Permissions that defines the exact features a Staff member can access while logged into their account. Staff accounts must be assigned to a group in order to access the platform and can only be assigned to one group at a time.

    Get default groups

    As part of the Permission Groups, Duda provides a set of default (predefined) groups that cannot be edited. These groups are set by Duda and are available for everyone to use. The big advantage of using the default groups is that they will be updated in the future as new features are released by Duda. If you create your own custom groups, Duda will not automatically add the feature to your custom group.

    JSON Response

    [{
        "group_name": "administrator",
        "color": "rgb(253,113,34)",
        "title": "Admin",
        "permissions": ["EDIT", "CREATE", "DELETE", "API", "DUDA_PRO", "MANAGE_USERS", "STATS", "E_COMMERCE", "MARKETING", "REPUBLISH", "PUBLISH", "DEV_MODE", "PURCHASE_IMAGES", SITE_CUSTOM_DOMAIN"]
    }, {
        "group_name": "salesman",
        "color": "rgb(36,206,151)",
        "title": "Sales",
        "permissions": ["CREATE", "MARKETING", "STATS", "REPUBLISH", "EDIT", "E_COMMERCE"]
    }, {
        "group_name": "designer",
        "color": "rgb(21,193,191)",
        "title": "Designer",
        "permissions": ["CREATE", "MARKETING", "REPUBLISH", "EDIT", "E_COMMERCE"]
    }, {
        "group_name": "storemanager",
        "color": "rgb(53,188,221)",
        "title": "Store Manager",
        "permissions": ["E_COMMERCE"]
    }]
    

    Example:

    curl -S -u 'APIusername:APIpassword' \
    -H 'Content-Type: application/json' \
    -X GET \
    -k https://api.dudamobile.com/api/permission-groups/default
    

    Method and path

    GET /permission-groups/default

    Response

    You can expect a 200 OK Response code for a successful call.

    Create custom group

    Create a new staff group. This group defines the features that a staff member will have access to when logging into their account. When creating a custom group, Duda will return a unique group_name to the Duda platform. We recommends storing the group_name value for future reference.

    Example JSON to send:

    {
        "color": "rgb(27,245,71)",
        "title": "Outside Sales",
        "permissions": ["STATS", "CREATE", "REPUBLISH", "EDIT"]
    }
    

    Example

    curl -S -u 'APIusername:APIpassword' \
    -H 'Content-Type: application/json' \
    -X POST \
    -k https://api.dudamobile.com/api/permission-groups/create \
    -d '{"group_name": "Mzc0MQ","color": "rgb(27,245,71)","title": "Outside Sales","permissions":["STATS", "CREATE", "REPUBLISH", "EDIT"]}' 
    

    JSON Response:

    {
        "group_name":"MjAwMg"
    }
    

    Method and Path

    POST /permission-groups/create

    Parameters

    You will need to send a JSON object that describes the group you wish to create:

    Property Type Required Description
    title String Required A short title to describe the group being created. Should be descriptive.
    color RGB/HEX color string Optional A hex or RGB color code to associate the group with. For example, #2d6598 or rgb(45,101,152).
    permissions array Required An array of strings that set the permissions for this group.

    Return

    You can expect a 200 OK response code for a successful call with a JSON object containing a unique group_name.

    Get custom groups

    Get all custom groups that have been created for this account. These are groups which have been created through the API or within the Duda Users & Permissions section of the dashboard.

    JSON Response:

    [{
        "group_name": "Mzc0MQ",
        "color": "rgb(27,245,71)",
        "title": "Outside Sales",
        "permissions": ["STATS", "CREATE", "REPUBLISH", "EDIT"]
    }, {
        "group_name": "MzczNQ",
        "color": "rgb(45,101,152)",
        "title": "QA",
        "permissions": ["PUBLISH", "REPUBLISH", "EDIT"]
    }]
    
    curl -S -u 'APIusername:APIpassword' \
    -H 'Content-Type: application/json' \
    -X GET \
    -k https://api.dudamobile.com/api/permission-groups/custom
    

    Method and path

    GET /permission-groups/custom

    Response

    You can expect a 200 OK Response code for a successful call with an array of objects describing the custom group. You can see the details about each value returned in the create custom group section.

    Update custom group

    Update an existing group. Use this if you want to change the features that a certain staff group has access to, change the title (name) of the group or set a new color to apply to the group.

    Example JSON to send:

    {
      "title": "Outside Sales",
      "color": "#85144b",
      "permissions": [
        "PRO_SETTINGS",
        "STATS",
        "MANAGE_STAFF",
        "CREATE_SITES",
        "DELETE_SITES",
        "MARKETING",
        "E_COMMERCE",
        "PUBLISH",
        "DEV_MODE",
        "EDIT_SITES",
        "CUSTOM_DOMAIN",
        "REPUBLISH"
      ]
    }
    

    Example

    curl -S -u 'APIusername:APIpassword' \
    -H 'Content-Type: application/json' \
    -X POST \
    -k https://api.dudamobile.com/api/permission-groups/Mzc0MQ/update \
    -d '{"color": "rgb(27,245,71)","title": "Outside Sales","permissions":["STATS", "CREATE", "REPUBLISH", "EDIT","CREATE_SITES"]}'
    

    Method and path

    POST /permission-groups/{group_name}/update

    Return

    You can expect a 204 No Content HTTP response code upon successful call.

    Get staff group permissions

    Get the details of a specific permission group.

    Example:

    curl -S -u 'APIusername:APIpassword' \
    -H 'Content-Type: application/json' \
    -X GET -k https://api.dudamobile.com/api/permission-groups/Mzc0MQ
    

    Example response body:

    {
      "title": "Outside Sales",
      "color": "#85144b",
      "permissions": [
        "PRO_SETTINGS",
        "STATS",
        "MANAGE_STAFF",
        "CREATE_SITES",
        "DELETE_SITES",
        "MARKETING",
        "E_COMMERCE",
        "PUBLISH",
        "DEV_MODE",
        "EDIT_SITES",
        "CUSTOM_DOMAIN",
        "REPUBLISH"
      ]
    }
    

    Method and path

    GET /permission-groups/{group_name}

    Parameters

    Response

    You can expect a 200 OK HTTP response for a successful call.

    Delete custom group

    Delete an already created custom group. This can't be undone.

    Method and path

    DELETE /permission-groups/{group_name}

    Example

    curl -S -u 'APIusername:APIpassword' \
    -H 'Content-Type: application/json' \
    -X DELETE -k https://api.dudamobile.com/api/permission-groups/Mzc0MQ 
    

    Parameters

    Return

    You can expect a 204 No Content HTTP response code for successful delete calls.

    Assign staff to group

    Assign a Staff Account to a specific group. Both the custom group and staff account must exist already. The account must be defined as a staff account. If this Staff acconut is already assigned to a group, they will be reassigned to the new group instead.

    Example call

    curl -S -u 'APIusername:APIpassword' \
    -H 'Content-Type: application/json' \
    -X POST -k https://api.dudamobile.com/api/permission-groups/Mzc0MQ/accounts/john-smith@gmail.com/add
    

    Method and path

    POST /permission-groups/{group_name}/accounts/{account_name}/add

    Parameters

    Return

    You can expect a 204 No Content HTTP response code for successful assign calls.

    Remove staff from group

    Remove a staff account from the group that they are currently assigned to. Please note that this will prevent the staff user from logging in, as staff account must be assigned to a group to log in.

    Example Call

    curl -S -u 'APIusername:APIpassword' \
    -H 'Content-Type: application/json' \
    -X POST -k https://api.dudamobile.com/api/permission-groups/Mzc0MQ/accounts/john-smith@gmail.com/add
    

    Method and path

    DELETE /permission-groups/{group_name}/accounts/{account_name}

    Parameters

    Analytics

    Get Analytics

    Get analytics history for a specific website over a certain amount of time.

    Method and path

    GET /analytics/site/{site_name}

    Parameters

    The following URL query parameters can be added on the end of the GET site API call.

    Analytics are updated every 24 hours, so you will not be able to pull analytics from the current day, only previous days.

    Query String Parameter Type Required Description
    from Date Optional. Defaults to 30 days prior to "to" value Give the start (date)[#date] of when you want to pull analytics from.
    to Date Optional. Defaults to the current day. Give an end date.
    dimension String Optional The type of dimension to query the data by: (1) "system": Set including Browser Type, Browser Version and Operating System, or (2) "geo": Country (and Region where available)
    result String Optional. Either "traffic" or "activities". Defaults to traffic. Whether to return results with traffic metrics (visits, unique visitors, pageviews), or to return results with activities metrics (click_to_calls, click_to_maps, click_to_emails, form_submits)
    dateGranularity String optional, can be: "DAYS", "WEEKS", "MONTHS", or "YEARS" When the dateGranularity URL parameter is present, Duda will return a data from the selected format. If you choose days for a specific week, Duda will return the visits for that specific day and each day within the date range defined.

    If neither the "from" parameter nor the "to" parameter is provided, the queried period will be the past 30 days.

    If only the "from" parameter is provided, the queried period will be the "from" date until today.

    If only the "to" parameter is provided, the queried period will be from 30 days prior to the "to" date until the "to" date.

    Querying: Traffic, not dimensioned:

    {"UNIQUE_VISITORS":50,"VISITS":100,"PAGE_VIEWS":150}
    

    Querying: Activities, not dimensioned:

    {"CLICK_TO_EMAILS":2,"FORM_SUBMITS":5, "CLICK_TO_MAPS":15,"CLICK_TO_CALLS":20}
    

    Querying: Traffic, Dimensioned by geo:

    [ {
        "data" : {
            "VISITORS" : 50,
            "PAGE_VIEWS" : 150,
            "VISITS" : 100
        },
        "dimension" : {
            "country" : "US",
            "region" : "CA"
        }
    }, {
        "data" : {
            "VISITORS" : 50,
            "PAGE_VIEWS" : 150,
            "VISITS" : 100
        },
        "dimension" : {
            "country" : "US",
            "region" : "FL"
        }
    }, {
        "data" : {
            "VISITORS" : 50,
            "PAGE_VIEWS" : 150,
            "VISITS" : 100
        },
        "dimension" : {
            "country" : "Canada",
            "region" : "Ontario"
        }
    } ]
    

    Return

    If the result parameter is "traffic":

    If a dimension set is provided, an array containing the following JSON elements for each row of the result set.

    If no dimension set is provided, a JSON structure containing the following elements.

    Parameter Type Description
    dimension JSON Structure A single dimension pertaining to the queried dimension type (if a dimension type was sent). Ex: The "geo" dimension type may return "dimension":{"Country":"Canada","Region":"Ontario"}
    VISITS integer For the queried period and for the specified dimension, the number of visits to the site.
    VISITORS integer For the queried period and for the specified dimension, the number of unique visitors to the site.
    PAGE_VIEWS integer For the queried period and for the specified dimension, the number of page views to the site.

    If the result parameter is "activities":

    If a dimension set is provided, an array containing the following JSON elements for each row of the result set.

    If no dimension set is provided, a JSON structure containing the following elements.

    Parameter Type Description
    dimension JSON Object A single dimension pertaining to the queried dimension type (if a dimension type was sent). Ex: The "geo" dimension type may return "dimension":{"Country":"Canada","Region":"Ontario"}
    click_to_calls integer For the queried period and for the specified dimension, the number of click-to-call actions on the site.
    click_to_maps integer For the queried period and for the specified dimension, the number of click-to-map actions on the site.
    click_to_emails integer For the queried period and for the specified dimension, the number of click-to-email actions on the site.
    form_submits integer For the queried period and for the specified dimension, the number of form submission actions on the site.

    Custom Widgets

    Duda has an API for custom widgets. This relates to widgets that exist within your master account. Currently, this API is used to localize widgets for different languages. Note that you must follow the instructions here to set up widgets for localization.

    Widget localiation work with key value parings. Inside of widget builder, you add a key value combination, where the key is used as a variable and the value is the default fallback for all languages. When localizing widgets, you send Duda a key value pair with the localized content for each specific locale you need to support.

    Get all custom widgets

    Example:

    curl -S -u 'APIusername:APIpassword' \
    -H 'Content-Type: application/json' \
    -X GET \
    -k https://api.dudamobile.com/api/widgets/list
    

    JSON Response

    [
      {
        "title": "Card",
        "id": "812a0ed5f2a54ccc8a66ccfd6fab3fc8"
      },
      {
        "title": "FAQ",
        "id": "f3e1efc5fb2e44d185c9a41643d11945"
      },
      {
        "title": "Facebook Page Feed",
        "id": "ab485aff625a480bbb2c660e880b0fbd"
      }
    ]
    

    Return an array of objects that describe all widgets in your account. Duda will return the title (name) and unique identifer for that widget. Note that this only returns custom widgets which are in your account.

    Method and path

    GET /widgets/list

    Response

    You can expect a 200 OK Response code for a successful call.

    Scan for available strings

    Search a widget for all available localization keys that have been inserted into the widget. This will return a list of all key value parings that have been added to the editors, HTML or JavaScript sections of the widget. The value that is returned will be the default text that was originally entered into the widget.

    Duda allows you to install localzion placeholders within three locations of widgets: (1) Content & Design Editors, (2) HTML (3) JavaScript. See below for how they shouild be formatted:

    Install Area Example
    Content or Design Editor {{key=default value/text}}
    HTML {{localize 'key' 'DEFAULT TEXT'}}
    JavaScript api.localize('key', 'DEFAULT TEXT')

    You can install the placeholders above into any area that displays text to the user directly, including the labels, placeholders, widget, HTML, JS, etc.. This API call will return all possible strings to be localized.

    Example

    curl -S -u 'APIusername:APIpassword' \
    -H 'Content-Type: application/json' \
    -X GET \
    -k https://api.dudamobile.com/api/widgets/{widgetId}/strings/scan
    

    JSON Response:

    {
      "HTMLKey": "DEFAULT TEXT in HTML",
      "key": "DEFAULT TEXT EDITOR",
      "JSKey": "DEFAULT TEXT JS"
    }
    

    Method and path

    GET /widgets/{widgetId}/strings/scan

    Response

    You can expect a 200 OK response code with an object of key value pairs.

    Get Widget Locale Strings

    Get all localized strings for a specific widget for a specific locale. You will pass Duda both the Widget ID and the locale of which you want to see what has already been set for a specific widget.

    Duda will return the key and then the language specific copy as the value to that key.

    Example

    curl -S -u 'APIusername:APIpassword' \
    -H 'Content-Type: application/json' \
    -X GET \
    -k https://api.dudamobile.com/api/widgets/f3e1efc5fb2e44d185c9a41643d11945/strings/en_gb
    

    JSON Response:

    {
        "FAQ_title":"English UK FAQ Title"
    }
    

    Method and Path

    GET /widgets/{widgetId}/strings/{localeCode}

    Parameters

    Response

    You can expect a 200 OK response code for a successful call with a JSON object that contains the key and localized content.

    Update widget locale strings

    Set the strings of a widget for a specific language. You can pass any key value pair. You will want to pass a JSON object of Key/Value entries that define the StringKey/String that will be used.

    You can pass key value pairs that are not yet installed in the widget, because Duda localizes widgets at the time of output/runtime, depending on the locale of the website or widget.

    Example Body to Send for Spanish:

    {
        "Widget.FAQ.Label":"FAQ Artículos",
        "Widget.FAQ.Tooltip":"Introduzca cada título, descripción, etc.",
        "Widget.FAQ.AddItem.Text":"Añadir nueva pregunta"
    }
    

    Example

    curl -S -u 'APIusername:APIpassword' \
    -H 'Content-Type: application/json' \
    -X POST \
    -k https://api.dudamobile.com/api/widgets/f3e1efc5fb2e44d185c9a41643d11945/strings/es
    -d '{
        "Widget.FAQ.Label":"FAQ Artículos",
        "Widget.FAQ.Tooltip":"Introduzca cada título, descripción, etc.",
        "Widget.FAQ.Add.Item.Text":"Añadir nueva pregunta"
    }'
    

    Method and path

    POST /widgets/{widgetId}/strings/{localeCode}

    Parameters

    URI Parameters:

    Body data:

    A JSON object of key value pairs.

    Response

    You can expect a 204 No Content response for a successful call.

    Publish widget locale strings

    Publish all the custom locale strings that have been added to the widget. This will only make the newly added strings available to live widgets. This only publishes the strings -- not the entire widget.

    Example

    curl -S -u 'APIusername:APIpassword' \
    -H 'Content-Type: application/json' \
    -X POST \
    -k https://api.dudamobile.com/api/widgets/f3e1efc5fb2e44d185c9a41643d11945/strings/[publish
    

    Method and path

    POST /widgets/{widgetId}/strings/publish

    Response

    A successful call will return a 204 No Content HTTP response code.

    Get available locales

    Get a list of available locales that the widget can be localized for. We will return an array of language codes.

    Example

    curl -S -u 'APIusername:APIpassword' \
    -H 'Content-Type: application/json' \
    -X GET \
    -k https://api.dudamobile.com/api/widgets/locales
    

    JSON Response:

    [
        "en",
        "es",
        "pt",
        "fr",
        "de",
        "tr",
        "en_gb",
        "it",
        "nl",
        "es_ar"
    ]
    

    Method and path

    GET /widgets/locales