Responsive Site Reference

Overview

A Site instance resource represents a single Duda site. There are two main types of Duda sites: mobile and responsive. Mobile represents a mobile only site and responsive represents a responsive site which can be view from any device. Below, you will see the API resources available for the responsive sites only.

Resource URIs

    • Create Site

      Call the DudaAPI to create a new responsive 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.

      POST /sites/multiscreen/create

      Parameters:

      The JSON structure that should be passed as request body:

      PropertyTypeRequiredDescription

      template_id int required Template ID of the template you want to base your new DudaOne site on. You can see the available templates here.
      url string optional Have Duda import content into the new site based off of an existing website. You may use an existing website address or Facebook business page. 
      default_domain_prefix string optional Set the default sub-domain for your site. This controls the <sub-domain-prefix>.dudaone.com address. 
      site_data object optional JSON structure 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).

      Site resource properties for site creation (site_data):

      PropertyTypeRequiredDescription

      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. 
      business_site_info Business Site InfoData Structure optional If phone number is provided, create site will populate a ‘Click-to-Call’ button with the phone number that is passed. If address is provided, create site will populate a ‘Mobile Map’ button with the address that is passed.
      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. (max 45 chars).

      A Site Business Info data structure is used by multiple Site APIs and is represented by the properties below. Providing this information during site creation improves the conversion of the mobile site and helps populate site data.

      PropertyTypeDescription

      business_name string  
      phone_number string  
      address Data structure containing an Address (as defined below)  
      opentable_info An array of OpenTable. (as defined below)  

      An Address data structure is used by multiple Site APIs and is represented by the following properties. 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.

      PropertyTypeDescription

      Street string  
      City string  
      State string  
      Country string  
      zip_code numeric string  

      An OpenTable Info data structure is used by multiple Site APIs and is represented by the properties below. Providing this will create an OpenTable button and help Duda find more information about the website online. This should be in a JSON array format, as you can provide multiple restaurant_id's while creating the site.

      PropertyTypeDescription

      restaurant_id string Ex: 111
      location string Ex: Downtown San Francisco
      country string Ex: US
       

      Site_alternate_domain resource 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. 

      PropertyTypeRequiredDescription

      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. If false, the alternate domains will resolve the full website under the alternate domain. Please note that it is not recommended to set this value to false, as it can create duplicate content SEO issues.

      Return:

      The following JSON structure :

      {"site_name":"28e1182c"}

      PropertyTypeDescription

      site_name string The unique site name of the created site. You should store this information for future use.

      Possible Errors:

      InvalidInput

      CURL Example:

      1 curl -S -u 'APIusername:APIpassword' -H 'Content-Type: application/json' -X POST -i -khttps://api.dudamobile.com/api/sites/multiscreen/create -d'{"template_id":"20012","url":"www.example.com","default_domain_prefix":"roti","site_data":{"site_domain":"www.example.com","external_uid":"AD3421","site_business_info":{"business_name":"Open Market","phone_number":"4157775577","address":{"country":"US","city":"San Francisco","state":"CA","street":"1 Market Street","zip_code":"94111"}}}}'
    • Retrieve Site (GET Site Info)

      Use this call to get information about an existing site. You should already know the site name, as it was provided to you after originally creating the site.

      GET /sites/multiscreen/{site_name}

      Parameters:

      • site_name - URL parameter - site name

      Return:

      The following JSON structure representing the Site:

      PropertyTypeDescription

      template_id string The current template_id of the template in use on the site.
      site_domain string Returns the site domain of the website if it has been set. This is the primary domain associated with the website.
      site_default_domain string Will return the default domain of the site. This value will look like: <site_name>.dudaone.com or <site_name>.mutliscreensite.com (partners only). This will be returned even if the site is not published, please make sure the site is published before trying to use this URL for the site. 
      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 email of the master account.
      preview_site_url url A URL you can send to visitors to display a three screen preview of the site.
      last_published_date date, in UTC: YYYY-MM-DDThh:mm:ss The time stamp of the most recent time the site was published or republished. If the site has never been published, this will not be returned.
      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 Business Site Info Data Structure 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.
      cetrtificate_status string The status of SSL certificate generation. Has three possible values: "COMPLETE", "IN PROGRESS", or "FAILED". 

      A successful response will return the HTTP Code: 200 OK

      Possible Errors:

      ResourceNotExist

      CURL Example:

      1 curl -S -u 'APIpassword:APIusername' -H 'Content-Type: application/json' -X GET -i -k https://api.dudamobile.com/api/sites/multiscreen/57b6506a
    • Retrieve Site by External ID

      This will return information about an existing site, much like retrieve site. Instead of supplying a site_name, you will send the external_uid you originally supplied when making the site.

      GET /sites/multiscreen/byexternal/{external_uid}

      Parameters:

      • site_name - URL parameter - site name

      Return:

      The following JSON structure representing the Site:

      PropertyTypeDescription

      template_id string The current template_id of the template in use on the site.
      site_default_domain string Will return the default domain of the site. This value will look like: <site_name>.dudaone.com or <site_name>.mutliscreensite.com (partners only).This will be returned even if the site is not published. Please make sure the site is published before trying to use this URL for the site. 
      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 email of the master account.
      preview_site_url url A URL you can send to visitors to display a three screen preview of the site.
      last_published_date date, in UTC: YYYY-MM-DDThh:mm:ss The time stamp of the most recent time the site was published or republished. If the site has never been published, this will not be returned.
      business_site_info Business Site Info Data Structure 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.

      Example Response:

      {
         "site_name":"c27cdebf",
         "account_name":"johnsmith@gmail.com",
         "preview_site_url":"http://preview.example.com/preview/c27cdebf",
         "site_business_info":{
            "business_name":"Pacific Catch - Sunset District",
            "address":{
               "street":"1200 9th Ave.",
               "city":"San Francisco",
               "state":"CA",
               "country":"United States",
               "zip_code":"94122"
            },
            "phone_number":"(415) 504-6905",
            "opentable_info":[
               {
                  "restaurant_id":"18013",
                  "country":"United States",
                  "location":"Pacific Catch - Sunset District"
               },
               {
                  "country":"United States",
                  "location":"Pacific Catch - Corte Madera"
               }
            ]
         },
         "site_default_domain":"pacificcatch-example.dudaone.com",
         "template_id":20013"
      }

      Possible Errors:

      ResourceNotExist

       

      Please note that the error 'AccessForbidden' can also be generated by this call whether or not your credentials are correct; if they are, this just means that the site detected by your search is not one to which you have access. When implementing this call, it is for this reason a good idea to treat AccessForbidden errors as you would ResourceNotExist errors for the purpose of your account.

       

      CURL Example:

      1 curl -S -u 'APIusername:APIpassword' -H 'Content-Type: application/json' -X GET -i -k https://api.dudamobile.com/api/sites/multiscreen/byexternal/1111
    • 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.

      POST /sites/multiscreen/update/{site_name}

      Required Parameters:

      • site_name - URL parameter - site name

      The JSON structure that should be passed as request body (at least one of the fields should be present):

      PropertyTypeRequiredDescription

      site_domain fully qualified domain name Optional Set the domain of the site you want to use. 
      default_domain_prefix string Optional Change the domain prefix that you want to use. This must be a unique value and not used on other sites.
      external_uid string Optional Placeholder for external system unique identifier. (max 45 chars)
      site_alternate_domains object Optional Set alternate domains for the site. The alternate domain values will be redirected to the primary domain. 
      force_https book Optional If true, all website traffic will be redirected to a secure (HTTPS) enabled. Only can be set if an SSL certificate is successfully generated.

      Example Data to Send:

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

       

      Return:

      • No JSON data response
      • HTTP Code: 204 No Content

      Possible Errors:

      ResourceNotExist

      InvalidInput

      CURL Example:

      1 curl -S -u 'APIusername:APIpassword' -H 'Content-Type: application/json' -X POST -k https://api.dudamobile.com/api/sites/multiscreen/update/57b6506a -d'{"site_domain":"www.uniquedomain.com"}'
    • 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. 

      DELETE /sites/multiscreen/{site_name}

      Parameters:

      • site_name - URL parameter - site name

      Return:

      • No JSON data response
      • HTTP Code: 204 No Content

      Possbile Errors:

      ResourceNotExist

      CURL Example:

      1 curl -S -u 'APIusername:APIpassword' -H 'Content-Type: application/json' -X DELETE -i -k https://api.dudamobile.com/api/sites/multiscreen/57b6506a
    • Publish Site

      Takes the development version of the site and copies it to production. 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 production version of the site with the development version.

      POST /sites/multiscreen/publish/{site_name}

      Parameters:

      • site_name - URL parameter - site name

      Return:

      • No JSON data response
      • HTTP Code: 204 No Content

      Possible Errors:

      ResourceNotExist

      CURL Example:

      1 curl -S -u 'APIusername:APIpassword' -H 'Content-Type: application/json' -X POST -i -k https://api.dudamobile.com/api/sites/multiscreen/publish/57b6506a
    • 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. Unpublishing a site does not cancel or pause the subscription/payment associated with the site.

      POST /sites/multiscreen/unpublish/{site_name}

      Parameters:

      • site_name - URL parameter - site name

      Return:

      • No JSON data response
      • HTTP Code: 204 No Content

      Possible Errors:

      ResourceNotExist

      CURL Example:

      1 curl -S -u 'APIusername:APIpassword' -H 'Content-Type: application/json' -X POST -i -k https://api.dudamobile.com/api/sites/multiscreen/unpublish/57b6506a
    • Retrieve Sites created during given period

      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.

      GET /sites/multiscreen/created?from=2014-03-01&to=2014-03-09

      Query String Parameters:

      Query String ParameterTypeRequiredDescription

      from Date optional, defaults to 7 days prior to "to" value Start Date Used for Lookup (In UTC: YYYY-MM-DDThh:mm:ss OR YYYY-MM-DD)
      to Date optional, defaults to current date End Date Used for Lookup (In UTC: YYYY-MM-DDThh:mm:ss OR YYYY-MM-DD)

      Return:

      Array containing the following JSON structure representing the Sites:

      PropertyTypeDescription

      site_name string The mobile site name. The site name is a unique identifier of the mobile site.

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

      Possible Errors:

      InvalidInput

      CURL Example:

      1 curl -S -u 'APIusername:APIpassword' -H 'Content-Type: application/json' -X GET -i -k 'https://api.dudamobile.com/api/sites/multiscreen/created?from=2014-03-01&to=2014-03-09'
    • Retrieve Multiple Sites

      By sending 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.

      POST /sites/multiscreen/get-many

      Parameters:

      An array should be posted should include one or more items of the following JSON structure, identifying the sites requested (maximum of 50):

      PropertyTypeRequiredDescription

      site_name string required the site_name of a site requested

      Return:

      The following JSON structure representing the Sites, as an array, will be returned:

      PropertyTypeDescription

      template_id string The current template_id of the template in use on the site.
      site_default_domain string Will return the default domain of the site. This value will look like: <site_name>.dudaone.com or <site_name>.mutliscreensite.com (partners only).. This will be returned even if the site is not published, please make sure the site is published before trying to use this URL fo the site. 
      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 email of the master account.
      preview_site_url url A URL you can send to visitors to display a three screen preview of the site.
      last_published_date date, in UTC: YYYY-MM-DDThh:mm:ss The time stamp of the most recent time the site was published or republished. If the site has never been published, this will not be returned.
      business_site_info Business Site Info Data Structure 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
       

      Will return a JSON array that looks as follows:

      {
         "sites":[
            {
               "site_name":"1aadcb7c",
               "account_name":"johnsmith@gmail.com",
               "preview_site_url":"http://example.domain.com/preview/1aadcb7c",
               "last_published_date":"2014-03-07T23:50:50",
               "site_business_info":{
                  "opentable_info":[
                     {
                     }
                  ]
               },
               "site_default_domain":"sitename.dudaone.com",
               "template_id":20012
            },
            {
               "site_name":"287185af",
               "account_name":"johnsmith@gmail.com",
               "preview_site_url":"http://example.domain.com/preview/287185af",
               "site_business_info":{
                  "opentable_info":[
                     {
                     }
                  ]
               },
               "site_default_domain":"sitename.dudaone.com",
               "template_id":20015
            }
         ]
      }

      Possible Errors:

      ResourceNotExist

      Example:

      1 curl -S -u 'APIusername:APIpassword' -H 'Content-Type: application/json' -X POST -i -k https://api.dudamobile.com/api/sites/multiscreen/get-many -d'[{"site_name":"287185af"},{"site_name":"1aadcb7c"}]'
    • Duplicate Site

      Create a duplicate of a particular responsive 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 DudaOne site builder, will be copied to the new version of the site.

      POST /sites/multiscreen/duplicate/{site_name}

      Parameters:

      • site_name - URL parameter - optional 

      PropertyTypeRequiredDescription

      new_default_domain_prefix string optional

      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 optional Specify a new external_uid (external user id) to the site when duplicating it. 

      Example JSON data to send:

      {"new_default_domain_prefix":"bobspizza","new_external_uid":"553112"}

      Return:

      • The newly created site name will be returned in JSON:

      {"site_name":"a6119858"}

      • HTTP Code: 200 OK

      Possible Errors:

      ResourceNotExist

      InvalidInput

      CURL Example:

      1 curl -S -u 'APIusername:APIpassword' -H 'Content-Type: application/json' -X POST -i -k https://api.dudamobile.com/api/sites/multiscreen/duplicate/287185af -d'{"new_default_domain_prefix":"bobspizza"}'
    • Get All Templates:

      Use this to get a JSON array of all possible templates to use. This list will update as Duda adds more templates to our platform. 

      GET /sites/multiscreen/templates

      Optional URL parameters:

      To get templates in a specific language, you can append the lang URL parameter (?lang=pt) on to the end of the URL to get templates in a specific language. Currently available languages are: en (English), jp (Japanese), pt (Portuguese), sp (Spanish), de (German), and en-uk (UK English). This defaults to en (English). 

      Data Returned:

      A JSON array of all the available templates will be returned. Below is a few, but there are many more available templates to choose from.

      [{
          "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,
          "base_site_name": "tg9deda1",
          "template_properties": {
              "can_build_from_url": false
          }
      }]

      PropertyTypeDescription

      template_name string The name of the template. This is up to you if you want to use it or not.
      preview_url URL

      A URL you can use to show a preview of the specific template. Users can visit the page and see how the template displays on all three screens. 

      thumbnail_url URL A direct URL to a jpg image displaying the templates. This would be good to use in a template selection page.
      template_id int A unique number representing the template number on the Duda platform. This will be used to create sites. 
      base_site_name string The unique site ID associated with this template. This only applies to custom templates created in your account. 
      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. 

      Possible Errors:

      None

      CURL Example:

      1 curl -S -u 'APIusername:APIpassword' -H 'Content-Type: application/json' -X GET -i -k https://api.dudamobile.com/api/sites/multiscreen/templates
    • Get Template Info

      Get the name, preview URL, thumbnail_url, and template ID of a particular 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.

      GET /sites/multiscreen/templates/20012

      Parameters:

      • template_id. Each template has it's own unique id to choose from.

      Optional URL parameters:

      To get templates in a specific language, you can append the lang URL parameter (?lang=pt) on to the end of the URL to get templates in a specific language. Currently available languages are: en (English), jp (Japanese), pt (Portuguese), sp (Spanish), de (German), and en-uk (UK English). This defaults to en (English). 

      Data Returned:

      JSON data about the template:

      {
          "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
          }
      }

      • HTTP Code: 200 OK

      Possible Errors:

      ResourceNotExist

      CURL Example:

      1 curl -S -u 'APIusername:APIpassword' -H 'Content-Type: application/json' -X GET -i -k https://api.dudamobile.com/api/sites/multiscreen/templates/20012
    • Create new template from a 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 also be available to select from while creating a new responsive site (under the My Templates section while creating a new responsive site).

      POST /sites/multiscreen/templates/fromsite

      Data Parameters:

      To create a template, you need to pass two required parameters to Duda in JSON format:

      • site_name - A valid site_name string of an already existing responsive site. 
      • new_template_name: A string of what to name the new template. 

      Example JSON data to send:

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

      Response:

      Upon successful completion a 200 response code will be returned along with the following JSON data about the template:

      {
          "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
          }
      }

      Note: Often when first creating a template, the thumbnail_url returned is a generic placeholder image. Duda will automatically generate a thumbnail image of the template as an asynchronous process that is often available a while after the initial template creation.

      Errors:

      ResourceNotExist

      InvalidInput

      CURL Example:

      1 curl -S -u 'APIUsername:APIPassword' -H 'Content-Type: application/json' -X POST -i -k -d '{"site_name":"66cbb9b7","new_template_name":"Example Template"}' https://api.dudamobile.com/api/sites/multiscreen/templates/fromsite
    • Create new template from existing Duda template

      Take an existing  template and create your own template from it. This will allow you to edit the template as your own to be used to create future sites from. Duda automatically generates a thumbnail image for the template. The URL for this thumbnail is available via the GET template API.

      POST /sites/multiscreen/templates/fromtemplate

      Data Parameters:

      To create a template, you need to pass two required parameters to Duda in JSON format:

      • template_id - A valid template ID of an existing Duda template. The template must be part of Duda's default template list. You can identify a default template if it has the template_properties of can_build_from_url of true.
      • new_template_name: A string of what to name the new template.

      Example JSON data to send:

      {
          "template_id": 20021,
          "new_template_name": "Example Template from Template"
      }

      Response:

      Upon successful completion a 200 response code will be returned along with the following JSON data about the template:

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

      Note: Often when first creating a template, the thumbnail_url returned is a generic placeholder image. Duda will automatically generate a thumbnail image of the template as an asynchronous process that is often available a while after the initial template creation.

      Errors:

      ResourceNotExist

      InvalidInput

      CURL Example:

      1 curl -S -u 'APIUsername:APIPassword' -H 'Content-Type: application/json' -X POST -i -k -d '{"template_id":20021,"new_template_name":"Example Template"}'https://api.dudamobile.com/api/sites/multiscreen/templates/fromtemplate
    • 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.

      DELETE /sites/multiscreen/templates/{template_id}

      URI Parameters:

      • Template ID - The unique id that identifies the template

      Response:

      Upon successful deletion a 204 response code will be returned.

      Errors:

      ResourceNotExist

      CURL Example:

      1 curl -S -u 'APIUsername:APIPassword' -H 'Content-Type: application/json' -X DELETE -i -k https://api.dudamobile.com/api/sites/multiscreen/templates/1000408
    • Update custom template

      Update the name of an existing custom template

      POST /sites/multiscreen/templates/{template_id}

      Data Parameters:

      To update the template name, pass the value of the name you want to change the template to.

      • value - A string that contains the new name of the template

      Example JSON data to send:

      {
          "new_name": "New template name"
      }

      Response:

      Upon successful update a 204 response code will be returned

      Errors:

      ResourceNotExist

      CURL Example:

      1 curl -S -u 'APIUsername:APIPassword' -H 'Content-Type: application/json' -X POST -i -k -d '{"new_name": "New template name"}'https://api.dudamobile.com/api/sites/multiscreen/templates/1000408
    • 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

      Properties returned

      Property Type Description
      page_name String The internal name/reference for the page. This value is also the URL where this page will be available once the site is published.
      page_title String The title of the page in the navigation of the site and also in the pages menu.

      Return

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

      [ { "page_name": "home", "page_title": "Home" }, { "page_name": "services111", "page_title": "Services" }, { "page_name": "contact", "page_title": "Contact" } ]

      curl example:

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

    • Update page

      Update an existing page on the website. You need to pass the page_title (returned via the GET Pages API Call).

      Method and path

      POST /api/sites/multiscreen/site/{siteName}/pages/{pageName}/update

      Required Properties

      • site_name - The name of the site, returned when it was originally created
      • page_name - The name of the page, returned from the get page(s) API call

      Return

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

      CURL Example

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

      Get the details of an individual page of the site. Currently, this is only useful to get the title of a page you know the name of already.

      Method and path

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

      Required URI inputs

      • site_name - Name of the site, originally returned when the site was created.
      • page_name - Name of the page, originally returned via the Get Sites API Call.

      Return

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

      Example JSON Return:

      {
      "page_name": "contact",
      "page_title": "contact 1"
      }

      CURL Example

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

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

      Method and path

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

      Required URI Inputs

      • site_name - Name of the site, originally returned when creating the website.
      • page_name - Name of the page, originally returned when getting the pages of the site.

      Return

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

      CURL Example:

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

      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. 

      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.

      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.

      Example Input

      [ { "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" ] } ]

      Return

      Duda will return a 204 No Content HTTP response code.

      CURL Example:

      curl -X POST -k 'https://api.dudamobile.com/api/api/sites/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" ] } ]'
    • 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:

      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 Input:

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

      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.

      Example Response

      { "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" } ] }
    • 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 we will return results for the last 7 days by default.

      GET /sites/multiscreen/published

      URI Parameters:

      • laysDays - The number of days in which you would like to get sites that have been published

      Example JSON response

      [ "a75b4ddc", "d2f8eded" ]

      Response:

      Upon success, a 200 response code will be returned

      Errors:

      InvalidInput

      CURL Example:

      1 curl -S -u 'APIUsername:APIPassword' -H 'Content-Type: application/json' -X GET -i -k https://api.dudamobile.com/api/sites/multiscreen/published?lastDays=30
    • 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.

      GET /sites/multiscreen/unpublished

      URI Parameters:

      • laysDays - The number of days in which you would like to get sites that have been published

      Example JSON response

      [ "a75b4ddc", "d2f8eded" ]

      Response:

      Upon success, a 200 response code will be returned

      Errors:

      InvalidInput

      CURL Example:

      1 curl -S -u 'APIUsername:APIPassword' -H 'Content-Type: application/json' -X GET -i -k https://api.dudamobile.com/api/sites/multiscreen/unpublished?lastDays=30
    • Get Contact Form Submissions

      Get all the contact form submissions that happened on this site. This call will return an array of each contact form submission. If you have different contact forms on your site and want to report on them separately, you should change the title of the contact form in the contact form settings in the editor.

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

      Parameters:

      • site_name - URL parameter - site name

      URI Parameters:

      • Date - You can include a 'to' or 'from' parameter on the URL. This will limit the range of what get's returned. If no to or from is passed, Duda will return all form submissions for the site. 

      URI Parameter ValueTypeRequiredDescription

      to Date Optional Start Date Used for Lookup (In UTC: YYYY-MM-DDThh:mm:ss OR YYYY-MM-DD)
      from Date Optional End Date Used for Lookup (In UTC: YYYY-MM-DDThh:mm:ss OR YYYY-MM-DD)

      Response:

      PropertyTypeDescription

      form_title string The title of the contact form as it was set in Duda. This is controlled inside of the contact form settings.
      date string A time stamp of when the contact form submission occurred. The time zone will be in UTC.
      message array An array of all the contact form

      JSON example data returned:

      [
         {
            "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"
         }
      ]

      Errors:

      ResourceNotExist

      CURL Example:

      1 curl -S -u 'APIusername:APIpassword' -H 'Content-Type: application/json' -X GET -i -k https://api.dudamobile.com/api/sites/multiscreen/get-forms/b4ra2g
    • 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.

      POST /sites/multiscreen/{site_name}/certificate

      URI Parameters:

      • site_name - URL parameter - site name

      Return:

      • No JSON data response
      • HTTP Code: 204 No Content

      Errors:

      ResourceNotExist

      InvalidInput

      CURL Example:

      1 curl -S -u 'APIusername:APIpassword' -H 'Content-Type: application/json' -X POST -i -k https://api.dudamobile.com/api/sites/multiscreen/b4ra2g/certificate
    • Delete SSL Certificate

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

      DELETE /sites/multiscreen/{site_name}/certificate

      URI Parameters:

      • site_name - URL parameter - site name

      Return:

      • No JSON data response
      • HTTP Code: 204 No Content

      Errors:

      ResourceNotExist

      CURL Example:

      1 curl -S -u 'APIusername:APIpassword' -H 'Content-Type: application/json' -X DELETE -i -k https://api.dudamobile.com/api/sites/multiscreen/b4ra2g/certificate
    • 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. Each site can have a maximum of 10 created backup versions and 5 that are automatically created upon each publish of the site (15 total). Backups that are automatically created will have a name such as: sitename_Auto_4

      GET /sites/multiscreen/backups/{site_name}

      Parameters:

      • site_name - URL parameter - site name

      Response:

      An array of site backups will be returned with the complete date and time (time is based on UTC) and the name of the backup.

      JSON example data returned:

      [
         {
            "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"
         }
      ]

      Errors:

      ResourceNotExist

      CURL Example:

      1 curl -S -u 'APIusername:APIpassword' -H 'Content-Type: application/json' -X GET -i api/sites/multiscreen/backups/b4ra2g
    • 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 completeled.

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

      Parameters:

      • site_name - URL parameter - site name

      You can optionally define the name of the backup by sending a JSON message with the name set, for example:

      {
         "name":"via-api"
      }

      Response:

      If you provided a name for your backup, only an HTTP 200 response will be returned noting a successful backup creation. If you did not provide name, Duda will automatically create a name and return it to you in JSON format:

      {
         "backup_name":"russ7_12"
      }

      Errors:

      ResourceNotExist

      ResourceAlreadyExist

      CURL Example:

      1 curl -S -u 'APIusername:APIpassword' -H 'Content-Type: application/json' -X POST -i -d '{"name":"backup-via-api"}'https://my.dudamobile.com/api/sites/multiscreen/backups/b4ra2g/create
    • Restore site backup

      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.

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

      Parameters:

      • site_name - URL parameter - site name
      • backup_name - URL parameter - backup name

      Response:

      Upon successful completion a 204 response code will be returned.

      Errors:

      ResourceNotExist

      CURL Example:

      1 curl -S -u 'APIusername:APIpassword' -X POST -ihttps://my.dudamobile.com/api/sites/multiscreen/backups/b4ra2g/restore/via-api
    • Delete site backup

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

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

      Parameters:

      • site_name - URL parameter - site name
      • backup_name - URL parameter - backup name

      Response:

      Upon successful completion a 204 response code will be returned.

      Errors:

      ResourceNotExist

      CURL Example:

      1 curl -S -u 'APIusername:APIpassword' -X DELETE -ihttps://my.dudamobile.com/api/sites/multiscreen/backups/b4ra2g/via-api

       

×

Priority Phone Support

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

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

Please Log in as a DudaPro

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

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