Get started updating a subproject using Node.js
Occassionally, you may need to update the details of a subproject using the Subproject API. This guide will walk you through how to update all details of your previously created subproject.
Note:
Before you can get started, you need the following already set up:
- All Subproject API configuration settings.
- Node.js and a familiarity with how to create a new app.
Set up your Node.js application
- Once you setup your free Sinch account, create a new node app with npm.
npm init
- Accept the defaults for the application.
- Add the fetch package with npm to generate the necessary dependencies.
npm install node-fetch
- Create a new file named
index.mjs
in the project and paste the provided code into the file.
Update your subproject
Now, we'll customize and run the code that will update your subproject.
Fill in your parameters
- Assign your values to the following parameters:
Parameter | Your value |
---|---|
YOUR_subprojectId | The subproject ID that you would like to update. |
displayName | The display name of the subproject is replaced by providing a new one. |
labels | Update any label key:value pairs. You can assign new values to current keys or add entirely new pairs. |
- Save the file.
- Execute the code and create your first subproject.
Run the following command:
node index.mjs
Next steps
Check out our full API reference for more subproject options.