This sample app will show you how to make XD Cloud Content API calls using Node.js.
After setting up the sample, you will have a Node.js app that:
- Runs on
https://localhost:8000
- Lets a user input a cloud document ID
- Returns the metadata of the cloud document
You can find a companion repo for this developer guide on GitHub.
Be sure to follow all instructions in the readme
.
- Node.js and the
npm
package manager - OpenSSL CLI
This guide will assume that you have read the Adobe OAuth 2.0 Guide for Web.
You must also have an API key by registering your app with us.
The following steps will help you get this sample up and running.
This example requires SSL, so you will need to create a self-signed cert using the OpenSSL CLI. Be sure to run this in the ./server
directory:
$ cd server
$ openssl req -x509 -newkey rsa:4096 -nodes -out cert.pem -keyout key.pem -days 365
Make sure that after running this command you have the cert.pem
and key.pem
files at the top level of the .server
directory.
The package.json
file contains a list of dependencies. Run the following command from the top level directory of the app to install these dependencies:
$ cd ..
$ npm install
Enter the required credentials in public/config.js
:
const apiKey = "YOUR-API-KEY";
const accessToken = "USER-ACCESS-TOKEN"
try {
if (module) {
module.exports = {
apiKey,
accessToken
}
}
}
catch (err) { }
You can get your API Key by contacting us. Note that accessToken
is only required if your application is going to access private XD cloud documents. In order to get the accessToken
, your app has to integrate Adobe IO OAuth workflow.
After completing the configuration steps, start the server:
$ npm start
To access the app, go to https://localhost:8000
. Click through any cert warnings in the browser.