@dudadev/partner-api
v2.10.0
Published
Provides convenient access to Duda's public APIs from applications written in server-side Javascript.
Downloads
2,064
Maintainers
Keywords
Readme
@dudadev/partner-api
The @dudadev/partner-api
library provides convenient access to Duda's public APIs from applications written in
server-side Javascript.
- Requirements
- Installation
- Usage
- Configuration
- Request Overrides
- Responses
- Debugging
- App Store
- More Information
Requirements
Node v14 or higher.
Installation
Install the package with:
npm install @dudadev/partner-api --save
# or
yarn add @dudadev/partner-api
Usage
The package needs to be configured with your API credentials:
const { Duda } = require("@dudadev/partner-api");
const duda = new Duda({
user: process.env.DUDA_API_USER,
pass: process.env.DUDA_API_PASS,
env: Duda.Envs.direct,
});
duda.sites
.get({ site_name: "a-site-name" })
.then((site) => console.log(site))
.catch((error) => console.error(error));
Or using ES modules and async/await
:
// async / await
(async function () {
try {
const site = await duda.sites.get({ site_name: "a-site-name" });
console.log(site);
} catch (error) {
console.log(error.status, error.error);
// handle error
}
})();
Configuration
Initialize with config object
The package can be initialized with several options:
const duda = new Duda({
user: "api-user",
pass: "api-pass",
env: Duda.Envs.sandbox, // also, .direct, .eu
});
API Environments
Duda.Envs.eu
: api.eu.duda.coDuda.Envs.direct
: api.duda.coDuda.Envs.sandbox
: api-sandbox.duda.co
Request Timeout
The request timeout limit. The maximum number of milliseconds before a request is considered to be timed out. This will trigger a timeout event handler and reject the promise with an ECONNRESET
error code. This option defaults to 10000ms.
const duda = new Duda({
...,
timeout: 1000
});
Network Retries
Automatic network retries can be enabled with the maxNetworkRetries config option. This will retry requests n times with exponential backoff if they fail due to an intermittent network problem. It's recommended you also set the timeout
config option when enabling retries. Keep in mind that the timeout config is related to the timeout of the request, it does not affect the timing of the exponential backoff.
const duda = new Duda({
...,
maxNetworkRetries: 2,
timeout: 1000
});
Request Overrides
You can override the http.RequestOptions of any method on a per-request basis by passing a second object with custom options:
const { Duda } = require("@dudadev/partner-api");
const duda = new Duda({
user: process.env.DUDA_API_USER,
pass: process.env.DUDA_API_PASS,
env: Duda.Envs.direct,
});
duda.sites
.get(
{ site_name: "a-site-name" },
{
host: "api-special.duda.co",
auth: "another-username:another-password",
headers: {
"X-CUSTOM-HEADER": "a-value",
},
},
)
.then((site) => console.log(site))
.catch((error) => console.error(error));
Responses
Success
The library will attempt to parse all successful responses as JSON, and will return the raw value if it can't.
Errors
The library will either throw (for promises) or return (for callbacks) the following payload after receiving a status code >= 400:
interface ErrorResponse<DudaError> {
status: number;
error: DudaError;
}
Debugging
You can debug requests made by the library by setting the DUDA_API_LOG_LEVEL
environment variable to one of the
following levels:
- error: only shows fatal errors
- warning: shows all errors and warnings
- info: high-level debugging information
- debug: verbose debugging information
The library will display logs that are >= DUDA_API_LOG_LEVEL
. So, for example, setting the log level to warning (2)
would log all warnings (2) and errors (1).
The logger will attempt to redact any sensitive information before it logs using the following regular expressions:
/(user(name)?|pass(word)?|auth(orization)?)":"[^"]+/gi
/(Bearer|Basic) [^"]+/gi
Example using debug
$ DUDA_API_LOG_LEVEL=debug node index.js
[debug] 8ce2a72d-d6b6-4fe8-bf39-45ebe99f7233 no http agent defined: received=undefined
[info] 8ce2a72d-d6b6-4fe8-bf39-45ebe99f7233 new request: method=get endpoint=api-sandbox.duda.co/api/sites/multiscreen/374f37ea1eff44e7966b2c685ded251a/pages
[debug] 8ce2a72d-d6b6-4fe8-bf39-45ebe99f7233 full request details: req={"headers":{},"method":"get","path":"/api/sites/multiscreen/374f37ea1eff44e7966b2c685ded251a/pages","auth": [redacted],"host":"api-sandbox.duda.co"}
[debug] 8ce2a72d-d6b6-4fe8-bf39-45ebe99f7233 data received: raw={"results":[{"uuid":"683340afe033436caab26cf8a548b1dd","title":"Home","path":"home","seo":{"no_index":false}}]}
[debug] 8ce2a72d-d6b6-4fe8-bf39-45ebe99f7233 request ended: status=200 time=0.51s
App Store API
If you're an app developer, you can access the App Store API under duda.appstore
after calling new Duda(opts)
.
Authenticating requests
API Endpoints protected by an X-DUDA-ACCESS-TOKEN
expect method calls to include a token
property set to the
authorization_code
without Bearer
included.
duda.appstore.sites.get({
site_name: "a-site-name",
token: "authorization-code",
});
Handling different api_endpoint
values
You can use the request override feature to set the host of a method call to the correct
api_endpoint
for a particular site.
function getSite(site: string) {
const { site_name, auth, api_endpoint } = getInstallFromDB(site);
return duda.appstore.sites.get(
{
site_name: site_name,
token: auth.authorization_code,
},
{
host: api_endpoint,
},
);
}
getSite("a-site-name")
.then((site) => console.log(site))
.catch((err) => console.log(err.status, err.error));
Utility functions
Included under Duda.appstore
is utils
which contains useful methods for validating webhooks & signatures.
function validateWebook(req: YourRequestObject): boolean {
// conform request object
return duda.appstore.utils.validateWebook(
process.env.SECRET_KEY,
req.headers,
req.body,
);
}
function validateSSO(req: YourRequestObject): boolean {
// conform request object
return duda.appstore.utils.validateSSOLink(process.env.SECRET_KEY, req.query);
}
Configuring the Duda instance at instantiation for App Store requests (beta)
As of 2.8.0 you can configure an instance of the Duda class with an App Store configuration, negating the need to pass your token on each request. This configuration will also automatically handle refreshing your token if the expiration date has passed. Note: You are still responsible for saving your new authorization and expiration date into your database.
const duda = new Duda(
{
user: "testing",
pass: "testing",
env: Duda.Envs.direct,
},
{
auth: appStoreAuthObject,
uuid: appUuid,
},
);
The optional second argument contains the UUID of your app (this is provided by Duda when starting your app build), and the entire auth object you receive when an app is installed onto a site.
Once configured in this fashion, any requests to methods under the appstore
namespace will no longer require a token.
return duda.appstore.sites.get(
{
site_name: site_name,
},
{
host: api_endpoint,
},
);
A second benefit of this configuration is that the object will check the expiration_date
on the supplied auth object before executing your App Store request. If the date has passed, it will call the token refresh endpoint and obtain a new auth object that contains an updated authorization_code
.
After aquiring a new code. The object will emit an event containing the entire auth object, which you should save to your db.
const duda = new Duda(
{
user: "testing",
pass: "testing",
env: Duda.Envs.direct,
},
{
auth: appStoreAuthObject,
uuid: appUuid,
},
);
duda.events.on("refresh", (auth) => {
// save the updated auth object with the rest of the app install data.
});
This feature is currently in beta, if you experience any issues while implementing the new configuration, please open an issue.
Sites
Get Site
Request
GET https://api.duda.co/api/sites/multiscreen/{site_name}
duda.sites.get({ site_name: site_name });
Get Site by External ID
Get Site by External ID Reference
Request
GET https://api.duda.co/api/sites/multiscreen/byexternalid/{external_uid}
duda.sites.getByExternalID({ external_uid: external_uid });
Create Site
Request
POST https://api.duda.co/api/sites/multiscreen/create
duda.sites.create({ template_id: template_id });
Update Site
Request
POST https://api.duda.co/api/sites/multiscreen/update/{site_name}
duda.sites.update({ site_name: site_name });
Duplicate Site
Request
POST https://api.duda.co/api/sites/multiscreen/duplicate/{site_name}
duda.sites.duplicate({
site_name: site_name,
new_default_domain_prefix: new_default_domain_prefix,
});
Publish Site
Request
POST https://api.duda.co/api/sites/multiscreen/publish/{site_name}
duda.sites.publish({ site_name: site_name });
Unpublish Site
Request
POST https://api.duda.co/api/sites/multiscreen/unpublish/{site_name}
duda.sites.unpublish({ site_name: site_name });
Reset Site
Request
POST https://api.duda.co/api/sites/multiscreen/reset/{site_name}
duda.sites.reset({ site_name: site_name, template_id: template_id });
Switch Template
Request
POST https://api.duda.co/api/sites/multiscreen/switchTemplate/{site_name}
duda.sites.switchTemplate({ site_name: site_name, template_id: template_id });
Delete Site
Request
DELETE https://api.duda.co/api/sites/multiscreen/{site_name}
duda.sites.delete({ site_name: site_name });
Get Site Theme
Request
GET https://api.duda.co/api/sites/multiscreen/{site_name}/theme
duda.sites.theme.get({ site_name: site_name });
Update Site Theme
Request
PUT https://api.duda.co/api/sites/multiscreen/{site_name}/theme
duda.sites.theme.update({ site_name: site_name });
Templates
List Templates
Request
GET https://api.duda.co/api/sites/multiscreen/templates
duda.templates.list();
Get Template
Request
GET https://api.duda.co/api/sites/multiscreen/templates/{template_id}
duda.templates.get({ template_id: template_id });
Update Template
Request
POST https://api.duda.co/api/sites/multiscreen/templates/{template_id}
duda.templates.update({ template_id: template_id });
Create From Site
Request
POST https://api.duda.co/api/sites/multiscreen/templates/fromsite
duda.templates.createFromSite({ site_name: site_name });
Create From Template
Create From Template Reference
Request
POST https://api.duda.co/api/sites/multiscreen/templates/fromtemplate
duda.templates.createFromTemplate({ template_id: template_id });
Delete Template
Request
DELETE https://api.duda.co/api/sites/multiscreen/templates/{template_id}
duda.templates.delete({ template_id: template_id });
Pages v2
List Pages
Request
GET https://api.duda.co/api/sites/multiscreen/{site_name}/pages
duda.pages.v2.list({ site_name: site_name });
Get Page
Request
GET https://api.duda.co/api/sites/multiscreen/{site_name}/pages/{page_uuid}
duda.pages.v2.get({ site_name: site_name, page_uuid: page_uuid });
Update Page
Request
PUT https://api.duda.co/api/sites/multiscreen/{site_name}/pages/{page_uuid}
duda.pages.v2.update({ site_name: site_name, page_uuid: page_uuid });
Create Page
Request
POST https://api.duda.co/api/sites/multiscreen/{site_name}/pages
duda.pages.v2.create({ site_name: site_name });
Duplicate Page
Request
POST https://api.duda.co/api/sites/multiscreen/{site_name}/pages/{page_uuid}/duplicate
duda.pages.v2.duplicate({ site_name: site_name, page_uuid: page_uuid });
Delete Page
Request
DELETE https://api.duda.co/api/sites/multiscreen/{site_name}/pages/{page_uuid}
duda.pages.v2.delete({ site_name: site_name, page_uuid: page_uuid });
Page Elements
List Page Elements
Request
GET https://api.duda.co/api/sites/multiscreen/{site_name}/pages/{page_uuid}/elements
duda.pages.elements.list({ site_name: site_name, page_uuid: page_uuid });
Create Page Element
Request
POST https://api.duda.co/api/sites/multiscreen/{site_name}/pages/{page_uuid}/elements
duda.pages.elements.create({ site_name: site_name, page_uuid: page_uuid });
Update Page Element
Request
PUT https://api.duda.co/api/sites/multiscreen/{site_name}/pages/{page_uuid}/elements/{element_id}
duda.pages.elements.update({
site_name: site_name,
page_uuid: page_uuid,
element_id: element_id,
});
Delete Page Element
Request
DELETE https://api.duda.co/api/sites/multiscreen/{site_name}/pages/{page_uuid}/elements/{element_id}
duda.pages.elements.delete({
site_name: site_name,
page_uuid: page_uuid,
element_id: element_id,
});
Sections
List Sections
Request
GET https://api.duda.co/api/sections
duda.sections.list();
Get Section
Request
GET https://api.duda.co/api/sections/{section_uuid}
duda.sections.get({ section_uuid: section_uuid });
Navigation
List Navigation
Request
GET https://api.duda.co/api/sites/multiscreen/{site_name}/navigation
duda.navigation.list({ site_name: site_name });
Get Navigation By Language
Get Navigation By Language Reference
Request
GET https://api.duda.co/api/sites/multiscreen/{site_name}/navigation/{lang}
duda.navigation.getByLang({ site_name: site_name, lang: lang });
Create Navigation
Request
POST https://api.duda.co/api/sites/multiscreen/{site_name}/navigation/{lang}/items
duda.navigation.create({ site_name: site_name, lang: lang });
Update Navigation
Request
PATCH https://api.duda.co/api/sites/multiscreen/{site_name}/navigation/{lang}/items/{navigation_id}
duda.navigation.update({
site_name: site_name,
lang: lang,
navigation_id: navigation_id,
});
Blog
Import Blog
Request
POST https://api.duda.co/api/sites/multiscreen/{site_name}/blog/import
duda.blog.import({ site_name: site_name });
Import Blog Post
Request
POST https://api.duda.co/api/sites/multiscreen/{site_name}/blog/posts/import
duda.blog.importPost({ site_name: site_name });
Delete Blog Post
Request
POST https://api.duda.co/api/sites/multiscreen/{site_name}/blog
duda.blog.delete({ site_name: site_name });
eComm
Get Settings
Request
GET https://api.duda.co/api/sites/multiscreen/{site_name}/ecommerce
duda.ecomm.get({ site_name: site_name });
Update Settings
Request
PATCH https://api.duda.co/api/sites/multiscreen/{site_name}/ecommerce
duda.ecomm.update({ site_name: site_name });
eComm Carts
List Carts
Request
GET https://api.duda.co/api/sites/multiscreen/{site_name}/ecommerce/carts
duda.ecomm.carts.list({ site_name: site_name });
Get Cart
Request
GET https://api.duda.co/api/sites/multiscreen/{site_name}/ecommerce/carts/{cart_id}
duda.ecomm.carts.get({ site_name: site_name, cart_id: cart_id });
eComm Orders
List Orders
Request
GET https://api.duda.co/api/sites/multiscreen/{site_name}/ecommerce/orders
duda.ecomm.orders.list({ site_name: site_name });
Get Order
Request
GET https://api.duda.co/api/sites/multiscreen/{site_name}/ecommerce/orders/{order_id}
duda.ecomm.orders.get({ site_name: site_name, order_id: order_id });
Update Order
Request
PATCH https://api.duda.co/api/sites/multiscreen/{site_name}/ecommerce/orders/{order_id}
duda.ecomm.orders.update({ site_name: site_name, order_id: order_id });
List Refunds
Request
GET https://api.duda.co/api/sites/multiscreen/{site_name}/ecommerce/orders/{order_id}/refunds
duda.ecomm.orders.listRefunds({ site_name: site_name, order_id: order_id });
Get Refund
Request
GET https://api.duda.co/api/sites/multiscreen/{site_name}/ecommerce/orders/{order_id}/refunds/{refund_id}
duda.ecomm.orders.getRefund({
site_name: site_name,
order_id: order_id,
refund_id: refund_id,
});
eComm Payment Gateways
List Payment Gateways
List Payment Gateways Reference
Request
GET https://api.duda.co/api/sites/multiscreen/{site_name}/ecommerce/payment-gateways
duda.ecomm.gateways.list({ site_name: site_name });
Get Payment Gateway
Request
GET https://api.duda.co/api/sites/multiscreen/{site_name}/ecommerce/payment-gateways/{gateway_id}
duda.ecomm.gateways.get({ site_name: site_name, gateway_id: gateway_id });
Create Payment Gateway
Create Payment Gateway Reference
Request
POST https://api.duda.co/api/sites/multiscreen/{site_name}/ecommerce/payment-gateways
duda.ecomm.gateways.create({
site_name: site_name,
live_payment_methods_url: live_payment_methods_url,
});
Update Payment Gateway
Update Payment Gateway Reference
Request
PATCH https://api.duda.co/api/sites/multiscreen/{site_name}/ecommerce/payment-gateways/{gateway_id}
duda.ecomm.gateways.update({
site_name: site_name,
gateway_id: gateway_id,
live_payment_methods_url: live_payment_methods_url,
});
Delete Payment Gateway
Delete Payment Gateway Reference
Request
DELETE https://api.duda.co/api/sites/multiscreen/{site_name}/ecommerce/payment-gateways/{gateway_id}
duda.ecomm.gateways.delete({ site_name: site_name, gateway_id: gateway_id });
eComm Payments
Get Payment Session
Request
GET https://api.duda.co/api/sites/multiscreen/{site_name}/ecommerce/payment-sessions/{session_id}
duda.ecomm.payments.get({ site_name: site_name, session_id: session_id });
Confirm Payment
Request
POST https://api.duda.co/api/sites/multiscreen/{site_name}/ecommerce/payment-sessions/{session_id}/confirm
duda.ecomm.payments.confirm({
site_name: site_name,
session_id: session_id,
state: state,
});
eComm Categories
Get Categories
Request
GET https://api.duda.co/api/sites/multiscreen/{site_name}/ecommerce/categories
duda.ecomm.categories.list({ site_name: site_name });
Get Category
Request
GET https://api.duda.co/api/sites/multiscreen/{site_name}/ecommerce/categories/{category_id}
duda.ecomm.categories.get({ site_name: site_name, category_id: category_id });
Create Category
Request
POST https://api.duda.co/api/sites/multiscreen/{site_name}/ecommerce/categories
duda.ecomm.categories.create({ site_name: site_name });
Update Category
Request
PATCH https://api.duda.co/api/sites/multiscreen/{site_name}/ecommerce/categories/{category_id}
duda.ecomm.categories.update({
site_name: site_name,
category_id: category_id,
});
Delete Category
Request
DELETE https://api.duda.co/api/sites/multiscreen/{site_name}/ecommerce/categories/{category_id}
duda.ecomm.categories.delete({
site_name: site_name,
category_id: category_id,
});
eComm Shipping Providers
List Shipping Providers
List Shipping Providers Reference
Request
GET https://api.duda.co/api/sites/multiscreen/{site_name}/ecommerce/shipping-providers
duda.ecomm.shipping.list({ site_name: site_name });
Get Shipping Provider
Get Shipping Provider Reference
Request
GET https://api.duda.co/api/sites/multiscreen/{siteAlias}/ecommerce/shipping-providers/{id}
duda.ecomm.shipping.get({ site_name: site_name, id: id });
Create Shipping Provider
Create Shipping Provider Reference
Request
POST https://api.duda.co/api/sites/multiscreen/{siteAlias}/ecommerce/shipping-providers
duda.ecomm.shipping.create({
site_name: site_name,
live_shipping_rates_url: live_shipping_rates_url,
});
Update Shipping Provider
Update Shipping Provider Reference
Request
PATCH https://api.duda.co/api/sites/multiscreen/{siteAlias}/ecommerce/shipping-providers/{id}
duda.ecomm.shipping.update({ site_name: site_name, id: id });
Delete Shipping Provider
Delete Shipping Provider Reference
Request
DELETE https://api.duda.co/api/sites/multiscreen/{siteAlias}/ecommerce/shipping-providers/{id}
duda.ecomm.shipping.delete({ site_name: site_name, id: id });
eComm Products
List Products
Request
GET https://api.duda.co/api/sites/multiscreen/{site_name}/ecommerce/products
duda.ecomm.products.list({ site_name: site_name });
Get Product
Request
GET https://api.duda.co/api/sites/multiscreen/{site_name}/ecommerce/products/{product_id}
duda.ecomm.products.get({ site_name: site_name, product_id: product_id });
Create Product
Request
CREATE https://api.duda.co/api/sites/multiscreen/{site_name}/ecommerce/products
duda.ecomm.products.create({ site_name: site_name });
Update Product
Request
PATCH https://api.duda.co/api/sites/multiscreen/{site_name}/ecommerce/products/{product_id}
duda.ecomm.products.update({ site_name: site_name, product_id: product_id });
Delete Product
Request
DELETE https://api.duda.co/api/sites/multiscreen/{site_name}/ecommerce/products/{product_id}
duda.ecomm.products.delete({ site_name: site_name, product_id: product_id });
eComm Variations
Get Product Variation
Get Product Variation Reference
Request
GET https://api.duda.co/api/sites/multiscreen/{site_name}/ecommerce/products/{product_id}/variations/{variation_id}
duda.ecomm.variations.get({
site_name: site_name,
product_id: product_id,
variation_id: variation_id,
});
Update Product Variation
Update Product Variation Reference
Request
PATCH https://api.duda.co/api/sites/multiscreen/{site_name}/ecommerce/products/{product_id}/variations/{variation_id}
duda.ecomm.variations.update({
site_name: site_name,
product_id: product_id,
variation_id: variation_id,
});
eComm Product Options
List Product Options
List Product Options Reference
Request
GET https://api.duda.co/api/sites/multiscreen/{site_name}/ecommerce/options
duda.ecomm.options.list({ site_name: site_name });
Get Product Option
Request
GET https://api.duda.co/api/sites/multiscreen/{site_name}/ecommerce/options/{option_id}
duda.ecomm.options.get({ site_name: site_name, option_id: option_id });
Create Product Option
Create Product Option Reference
Request
CREATE https://api.duda.co/api/sites/multiscreen/{site_name}/ecommerce/options
duda.ecomm.options.create({
site_name: site_name,
choices: choices,
name: name,
});
Update Product Option
Update Product Option Reference
Request
PUT https://api.duda.co/api/sites/multiscreen/{site_name}/ecommerce/options/{option_id}
duda.ecomm.options.update({
site_name: site_name,
option_id: option_id,
name: name,
});
Delete Product Option
Delete Product Option Reference
Request
DELETE https://api.duda.co/api/sites/multiscreen/{site_name}/ecommerce/options/{option_id}
duda.ecomm.options.delete({ site_name: site_name, option_id: option_id });
Create Product Option Choice
Create Product Option Choice Reference
Request
POST https://api.duda.co/api/sites/multiscreen/{site_name}/ecommerce/options/{option_id}/choices
duda.ecomm.options.createChoice({
site_name: site_name,
option_id: option_id,
value: value,
});
Update Product Option Choice
Update Product Option Choice Reference
Request
PUT https://api.duda.co/api/sites/multiscreen/{site_name}/ecommerce/options/{option_id}/choices/{choice_id}
duda.ecomm.options.createChoice({
site_name: site_name,
option_id: option_id,
choice_id: choice_id,
value: value,
});
Delete Product Option Choice
Delete Product Option Choice Reference
Request
DELETE https://api.duda.co/api/sites/multiscreen/{site_name}/ecommerce/options/{option_id}/choices/{choice_id}
duda.ecomm.options.createChoice({
site_name: site_name,
option_id: option_id,
choice_id: choice_id,
});
URL Rules
List Rules
Request
GET https://api.duda.co/api/sites/multiscreen/site/{site_name}/urlrules
duda.urlRules.list({ site_name: site_name });
Get Rule
Request
GET https://api.duda.co/api/sites/multiscreen/site/{site_name}/urlrules/{id}
duda.urlRules.get({ site_name: site_name, id: id });
Create Rule
Request
POST https://api.duda.co/api/sites/multiscreen/site/{site_name}/urlrules
duda.urlRules.create({ site_name: site_name });
Update Rule
Request
PUT https://api.duda.co/api/sites/multiscreen/site/{site_name}/urlrules/{id}
duda.urlRules.update({ site_name: site_name, id: id });
Delete Rule
Request
DELETE https://api.duda.co/api/sites/multiscreen/site/{site_name}/urlrules/{id}
duda.urlRules.update({ site_name: site_name, id: id });
Site Plans
List Site Plans
Request
GET https://api.duda.co/api/sites/multiscreen/plans
duda.plans.list();
Get Site Plan
Request
GET https://api.duda.co/api/sites/multiscreen/{site_name}/plan
duda.plans.get({ site_name: site_name });
Update Site Plan
Request
POST https://api.duda.co/api/sites/multiscreen/{site_name}/plan/{plan_id}
duda.plans.update({ site_name: site_name, plan_id: plan_id });
Accounts
Get Account
Request
GET https://api.duda.co/api/accounts/{account_name}
duda.accounts.get({ account_name: account_name });
Create Account
Request
POST https://api.duda.co/api/accounts/create
duda.accounts.create({ account_name: account_name });
Update Account
Request
POST https://api.duda.co/api/accounts/update/{account_name}
duda.accounts.update({ account_name: account_name });
Delete Account
Request
DELETE https://api.duda.co/api/accounts/{account_name}
duda.accounts.delete({ account_name: account_name });
Authentication
Get SSO Link
Request
GET https://api.duda.co/api/accounts/sso/{account_name}/link
duda.accounts.authentication.getSSOLink({ account_name: account_name });
Create Password Reset Link
Create Password Reset Link Reference
Request
POST https://api.duda.co/api/accounts/reset-password/{account_name}
duda.accounts.authentication.getResetPasswordLink({
account_name: account_name,
});
Create Welcome Link
Request
POST https://api.duda.co/api/accounts/reset-password/{account_name}
duda.accounts.authentication.getWelcomeLink({ account_name: account_name });
Permissions
List Client Permissions
List Client Permissions Reference
Request
GET https://api.duda.co/api/accounts/permissions/multiscreen
duda.accounts.permissions.list();
Get Client Permissions
Get Client Permissions Reference
Request
GET https://api.duda.co/api/accounts/{account_name}/sites/{site_name}/permissions
duda.accounts.permissions.get({
account_name: account_name,
site_name: site_name,
});
List Client Sites
Request
GET https://api.duda.co/api/accounts/grant-access/{account_name}/sites/multiscreen
duda.accounts.permissions.listAccessibleSites({ account_name: account_name });
Grant Site Access
Request
POST https://api.duda.co/api/accounts/{account_name}/sites/{site_name}/permissions
duda.accounts.permissions.grantSiteAccess({
account_name: account_name,
site_name: site_name,
});
Remove Site Access
Request
DELETE https://api.duda.co/api/accounts/{account_name}/sites/{site_name}/permissions
duda.accounts.permissions.removeSiteAccess({
account_name: account_name,
site_name: site_name,
});
List Duda Team Groups
List Duda Team Groups Reference
Request
GET https://api.duda.co/api/permission-groups/default
duda.accounts.permissions.listDudaTeamGroups();
List Custom Team Groups
List Custom Team Groups Reference
Request
GET https://api.duda.co/api/permission-groups/custom
duda.accounts.permissions.listCustomTeamGroups();
Assign Team Member to Group
Assign Team Member to Group Reference
Request
POST https://api.duda.co/api/permission-groups/{group_name}/accounts/{account_name}/add
duda.accounts.permissions.assignTeamMemberGroup({
group_name: group_name,
account_name: account_name,
});
Content
Get Content Library
Request
GET https://api.duda.co/api/sites/multiscreen/{site_name}/content
duda.content.get({ site_name: site_name });
Update Content Library
Update Content Library Reference
Request
POST https://api.duda.co/api/sites/multiscreen/{site_name}/content
duda.content.update({ site_name: site_name });
Publish Content Library
Publish Content Library Reference
Request
POST https://api.duda.co/api/sites/multiscreen/{site_name}/content/publish
duda.content.publish({ site_name: site_name });
Get Location
Request
GET https://api.duda.co/api/sites/multiscreen/{site_name}/content/location/{location_id}
duda.content.multilocation.get({
site_name: site_name,
location_id: location_id,
});
Create Location
Request
POST https://api.duda.co/api/sites/multiscreen/{site_name}/content/location
duda.content.multilocation.create({ site_name: site_name });
Update Location
Request
POST https://api.duda.co/api/sites/multiscreen/{site_name}/content/location/{location_id}
duda.content.multilocation.update({
site_name: site_name,
location_id: location_id,
});
Delete Location
Request
DELETE https://api.duda.co/api/sites/multiscreen/{site_name}/content/location/{location_id}
duda.content.multilocation.delete({
site_name: site_name,
location_id: location_id,
});
Get Injected Content
Get Injected Content Reference
Request
GET https://api.duda.co/api/sites/multiscreen/inject-content/{site_name}
duda.content.injectedContent.get({ site_name: site_name });
Create Injected Content
Create Injected Content Reference
Request
POST https://api.duda.co/api/sites/multiscreen/inject-content/{site_name}
duda.content.injectedContent.create({ site_name: site_name });
Create Injected Content (Single Page)
Create Injected Content (Single Page) Reference
Request
POST https://api.duda.co/api/sites/multiscreen/inject-content/{site_name}/pages/{page_name}
duda.content.injectedContent.createSPA({
site_name: site_name,
page_name: page_name,
});
Upload Resource
Request
POST https://api.duda.co/api/sites/multiscreen/resources/{site_name}/upload
duda.content.uploadResource({ site_name: site_name });
Snippets
List Snippets
Request
GET https://api.duda.co/api/sites/multiscreen/{site_name}/snippets
duda.snippets.list({ site_name: site_name });
Get Snippet
Request
GET https://api.duda.co/api/sites/multiscreen/{site_name}/snippets/{id}
duda.snippets.get({ site_name: site_name, id: id });
Create Snippet
Request
POST https://api.duda.co/api/sites/multiscreen/{site_name}/snippets
duda.snippets.create({ site_name: site_name });
Update Snippet
Request
PATCH https://api.duda.co/api/sites/multiscreen/{site_name}/snippets/{id}
duda.snippets.update({ site_name: site_name, id: id });
Publish Snippet
Request
POST https://api.duda.co/api/sites/multiscreen/{site_name}/snippets/{id}/publish
duda.snippets.publish({ site_name: site_name, id: id });
Delete Snippet
Request
DELETE https://api.duda.co/api/sites/multiscreen/{site_name}/snippets/{id}
duda.snippets.delete({ site_name: site_name, id: id });
Collections
List Collections
Request
GET https://api.duda.co/api/sites/multiscreen/{site_name}/collection
duda.collections.list({ site_name: site_name });
Get Collection
Request
GET https://api.duda.co/api/sites/multiscreen/{site_name}/collection/{collection_name}
duda.collections.get({
site_name: site_name,
collection_name: collection_name,
});
Create Collection
Request
POST https://api.duda.co/api/sites/multiscreen/{site_name}/collection
duda.collections.create({ site_name: site_name, name: name });
Update Collection
Request
PUT https://api.duda.co/api/sites/multiscreen/{site_name}/collection/{current_collection_name}
duda.collections.update({
site_name: site_name,
current_collection_name: current_collection_name,
});
Delete Collection
Request
DELETE https://api.duda.co/api/sites/multiscreen/{site_name}/collection/{collection_name}
duda.collections.delete({
site_name: site_name,
collection_name: collection_name,
});
Clear Cache
Request
POST https://api.duda.co/api/sites/multiscreen/{site_name}/collection/{collection_name}/revalidate
duda.collections.clearCache({
site_name: site_name,
collection_name: collection_name,
});
Clear Cache by External ID
Clear Cache by External ID Reference
Request
POST https://api.duda.co/api/sites/multiscreen/collections/revalidate/{external_id}
duda.collections.clearCacheByExtID({ external_id: external_id });
Create Rows
Request
POST https://api.duda.co/api/sites/multiscreen/{site_name}/collection/{collection_name}/row
duda.collections.rows.create({
site_name: site_name,
collection_name: collection_name,
});
Update Rows
Request
PUT https://api.duda.co/api/sites/multiscreen/{site_name}/collection/{collection_name}/row
duda.collections.rows.update({
site_name: site_name,
collection_name: collection_name,
});
Delete Row
Request
DELETE https://api.duda.co/api/sites/multiscreen/{site_name}/collection/{collection_name}/row/{row_id}
duda.collections.rows.deleteRow({
site_name: site_name,
collection_name: collection_name,
row_id: row_id,
});
Delete Rows
Request
DELETE https://api.duda.co/api/sites/multiscreen/{site_name}/collection/{collection_name}/row
duda.collections.rows.delete({
site_name: site_name,
collection_name: collection_name,
});
Create Fields
Request
POST https://api.duda.co/api/sites/multiscreen/{site_name}/collection/{collection_name}/field
duda.collections.fields.create({
site_name: site_name,
collection_name: collection_name,
});
Update Field
Request
PUT https://api.duda.co/api/sites/multiscreen/{site_name}/collection/{collection_name}/field/{field_name}
duda.collections.fields.update({
site_name: site_name,
collection_name: collection_name,
field_name: field_name,
});
Delete Field
Request
DELETE https://api.duda.co/api/sites/multiscreen/{site_name}/collection/{collection_name}/field/{field_name}
duda.collections.fields.delete({
site_name: site_name,
collection_name: collection_name,
field_name: field_name,
});
Reporting
Site Created
Request
GET https://api.duda.co/api/sites/multiscreen/created
duda.reporting.sites.created();
Sites Published
Request
GET https://api.duda.co/api/sites/multiscreen/published
duda.reporting.sites.published();
Sites Unpublished
Request
GET https://api.duda.co/api/sites/multiscreen/unpublished
duda.reporting.sites.unpublished();
Form Submissions
Request
GET https://api.duda.co/api/sites/multiscreen/get-forms/{site_name}
duda.reporting.forms.submissions({ site_name: site_name });
Activities
Request
GET https://api.duda.co/api/sites/multiscreen/{site_name}/activities
duda.reporting.activities.get({ site_name: site_name });
Analytics
Request
GET https://api.duda.co/api/analytics/site/{site_name}
duda.reporting.analytics.get({ site_name: site_name });
Get Client Settings
Request
GET https://api.duda.co/api/accounts/{account_name}/sites/{site_name}/stats-email
duda.reporting.emailSettings.get({
account_name: account_name,
site_name: site_name,
});
Create Subscription
Request
POST https://api.duda.co/api/accounts/{account_name}/sites/{site_name}/stats-email
duda.reporting.emailSettings.subscribe({
account_name: account_name,
site_name: site_name,
frequency: frequency,
});
Unsubscribe
Request
DELETE https://api.duda.co/api/accounts/{account_name}/sites/{site_name}/stats-email
duda.reporting.emailSettings.unsubscribe({
account_name: account_name,
site_name: site_name,
});
Other
List Backups
Request
GET https://api.duda.co/api/sites/multiscreen/backups/{site_name}
duda.other.backups.list({ site_name: site_name });
Create Backup
Request
POST https://api.duda.co/api/sites/multiscreen/backups/{site_name}/create
duda.other.backups.create({ site_name: site_name });
Restore Backup
Request
POST https://api.duda.co/api/sites/multiscreen/backups/{site_name}/restore/{backup_name}
duda.other.backups.restore({ site_name: site_name, backup_name: backup_name });
Delete Backup
Request
DELETE https://api.duda.co/api/sites/multiscreen/backups/{site_name}/{backup_name}
duda.other.backups.delete({ site_name: site_name, backup_name: backup_name });
Create Certificate
Request
POST https://api.duda.co/api/sites/multiscreen/{site_name}/certificate
duda.other.ssl.create({ site_name: site_name });
Renew Certificate
Request
POST https://api.duda.co/api/sites/multiscreen/{site_name}/certificate/renew
duda.other.ssl.renew({ site_name: site_name });
Delete Certificate
Request
DELETE https://api.duda.co/api/sites/multiscreen/{site_name}/certificate
duda.other.ssl.delete({ site_name: site_name });
Simple Editor
Update Simple Editor Settings
Update Simple Editors Settings Reference
Request
PATCH https://api.duda.co/api/sites/multiscreen/{site_name}/simple-editor
duda.diyEditor.update({
site_name: site_name,
onboarding_required: onboarding_required,
});
Appstore Accounts
Get Account Details
Request
GET https://api.duda.co/api/integrationhub/application/site/{site_name}/account/details
duda.appstore.accounts.getOwner({ site_name: site_name });
Appstore Sites
Get Site
Request
GET https://api.duda.co/api/integrationhub/application/site/{site_name}
duda.appstore.sites.get({ site_name: site_name });
Update Site
Request
POST https://api.duda.co/api/integrationhub/application/site/{site_name}
duda.appstore.sites.update({ site_name: site_name });
Get Branding Details
Get Branding Details Reference
Request
GET https://api.duda.co/api/integrationhub/application/site/{site_name}/branding
duda.appstore.sites.getBrandingDetails({ site_name: site_name });
Republish Site
Request
POST https://api.duda.co/api/integrationhub/application/site/{site_name}/republish
duda.appstore.sites.republish({ site_name: site_name });
Upload Resources
Request
POST https://api.duda.co/api/integrationhub/application/site/{site_name}/resources/upload
duda.appstore.sites.uploadResources({ site_name: site_name });
Appstore Content
Get Content Library
Request
GET https://api.duda.co/api/integrationhub/application/site/{site_name}/content
duda.appstore.content.get({ site_name: site_name });
Update Content Library
Update Content Library Reference
Request
POST https://api.duda.co/api/integrationhub/application/site/{site_name}/content
duda.appstore.content.update({ site_name: site_name });
Publish Content Library
Publish Content Library Reference
Request
POST https://api.duda.co/api/integrationhub/application/site/{site_name}/content/publish
duda.appstore.content.publish({ site_name: site_name });
Get Location
Request
GET https://api.duda.co/api/integrationhub/application/site/{site_name}/content/location/{location_id}
duda.appstore.content.locations.get({
site_name: site_name,
location_id: location_id,
});
Create Location
Request
POST https://api.duda.co/api/integrationhub/application/site/{site_name}/content/location
duda.appstore.content.locations.create({ site_name: site_name });
Update Location
Request
POST https://api.duda.co/api/integrationhub/application/site/{site_name}/content/location/{location_id}
duda.appstore.content.locations.update({
site_name: site_name,
location_id: location_id,
});
Delete Location
Request
DELETE https://api.duda.co/api/integrationhub/application/site/{site_name}/content/location/{location_id}
duda.appstore.content.locations.delete({
site_name: site_name,
location_id: location_id,
});
Appstore Pages
Get Pages
Request
GET https://api.duda.co/api/integrationhub/application/site/{site_name}/v2/pages
duda.appstore.pages.get({ site_name: site_name });
Update Page
Request
PUT https://api.duda.co/api/integrationhub/application/site/{site_name}/v2/pages/{page_uuid}
duda.appstore.pages.update({ site_name: site_name, page_uuid: page_uuid });
Appstore eComm
Get Settings
Request
GET https://api-sandbox.duda.co/api/integrationhub/application/site/{site_name}/ecommerce
duda.appstore.ecomm.get({ site_name: site_name });
Update Settings
Request
PATCH https://api-sandbox.duda.co/api/integrationhub/application/site/{site_name}/ecommerce
duda.appstore.ecomm.update({ site_name: site_name });
Appstore eComm Products
List Products
Request
GET https://api-sandbox.duda.co/api/integrationhub/application/site/{site_name}/ecommerce/products
duda.appstore.ecomm.products.list({ site_name: site_name });
Get Product
Request
GET https://api-sandbox.duda.co/api/integrationhub/application/site/{site_name}/ecommerce/products/{product_id}
duda.appstore.ecomm.products.get({
site_name: site_name,
product_id: product_id,
});
Create Product
Request
POST https://api-sandbox.duda.co/api/integrationhub/application/site/{site_name}/ecommerce/products
duda.appstore.ecomm.products.create({ site_name: site_name });
Update Product
Request
PATCH https://api-sandbox.duda.co/api/integrationhub/application/site/{site_name}/ecommerce/products/{product_id}
duda.appstore.ecomm.products.update({
site_name: site_name,
product_id: product_id,
});
Delete Product
Request
DELETE https://api-sandbox.duda.co/api/integrationhub/application/site/{site_name}/ecommerce/products/{product_id}
duda.appstore.ecomm.products.delete({
site_name: site_name,
product_id: product_id,
});
Appstore eComm Variations
Get Product Variation
Get Product Variation Reference
Request
GET https://api-sandbox.duda.co/api/integrationhub/application/site/{site_name}/ecommerce/products/{product_id}/variations/{variation_id}
duda.appstore.ecomm.variations.get({
site_name: site_name,
product_id: product_id,
variation_id: variation_id,
});
Update Product Variation
Update Product Variation Reference
Request
PATCH https://api-sandbox.duda.co/api/integrationhub/application/site/{site_name}/ecommerce/products/{product_id}/variations/{variation_id}
duda.appstore.ecomm.variations.update({
site_name: site_name,
product_id: product_id,
variation_id: variation_id,
});
Appstore eComm Product Options
List Product Options
List Product Options Reference
Request
GET https://api-sandbox.duda.co/api/integrationhub/application/site/{site_name}/ecommerce/options
duda.appstore.ecomm.options.list({ site_name: site_name });
Get Product Option
Request
GET https://api-sandbox.duda.co/api/integrationhub/application/site/{site_name}/ecommerce/options/{option_id}
duda.appstore.ecomm.options.get({ site_name: site_name, option_id: option_id });
Create Product Option
Create Product Option Reference
Request
POST https://api-sandbox.duda.co/api/integrationhub/application/site/{site_name}/ecommerce/options
duda.appstore.ecomm.options.create({
site_name: site_name,
name: name,
choices: choices,
});
Update Product Option
Update Product Option Reference
Request
PUT https://api-sandbox.duda.co/api/integrationhub/application/site/{site_name}/ecommerce/options/{option_id}
duda.appstore.ecomm.options.update({
site_name: site_name,
option_id: option_id,
name: name,
});
Delete Product Option
Delete Product Option Reference
Request
DELETE https://api-sandbox.duda.co/api/integrationhub/application/site/{site_name}/ecommerce/options/{option_id}
duda.appstore.ecomm.options.delete({
site_name: site_name,
option_id: option_id,
});
Create Product Option Choice
Create Product Option Choice Reference
Request
POST https://api-sandbox.duda.co/api/integrationhub/application/site/{site_name}/ecommerce/options/{option_id}/choices
duda.appstore.ecomm.options.createChoice({
site_name: site_name,
option_id: option_id,
value: value,
});
Update Product Option Choice
Update Product Option Choice Reference
Request
PUT https://api-sandbox.duda.co/api/integrationhub/application/site/{site_name}/ecommerce/options/{option_id}/choices/{choice_id}
duda.appstore.ecomm.options.createChoice({
site_name: site_name,
option_id: option_id,
choice_id: choice_id,
value: value,
});
Delete Product Option Choice
Delete Product Option Choice Reference
Request
DELETE https://api-sandbox.duda.co/api/integrationhub/application/site/{site_name}/ecommerce/options/{option_id}/choices/{choice_id}
duda.appstore.ecomm.options.createChoice({
site_name: site_name,
option_id: option_id,
choice_id: choice_id,
});
Appstore eComm Orders
List Orders
Request
GET https://api-sandbox.duda.co/api/integrationhub/application/site/{site_name}/ecommerce/orders
duda.appstore.ecomm.orders.list({ site_name: site_name });
Get Order
Request
GET https://api-sandbox.duda.co/api/integrationhub/application/site/{site_name}/ecommerce/orders/{order_id}
duda.appstore.ecomm.orders.get({ site_name: site_name, order_id: order_id });
Update Order
[Update Order Referen