Skip to content
Permalink
Browse files

Updating JavaScript SDK

  • Loading branch information...
Travis CI User
Travis CI User committed Mar 29, 2019
1 parent d26dac3 commit 1ea3560580300602727d1b2301f6a4b8e340a9d6
Showing with 409 additions and 380 deletions.
  1. +143 −130 docs/AudioApi.md
  2. +24 −17 docs/EditorialApi.md
  3. +132 −116 docs/ImagesApi.md
  4. +110 −117 docs/VideosApi.md
@@ -31,28 +31,36 @@ This endpoint adds one or more tracks to a collection by track IDs.
### Example

```javascript
const sstk = require('shutterstock-api');
// To use OAuth access token authorization:
sstk.setAccessToken(process.env.SHUTTERSTOCK_API_TOKEN);
const api = new sstk.AudioApi();
const id = "\"48433115\""; // String | Collection ID
const body = new ShutterstockApiReference.CollectionItemRequest(); // CollectionItemRequest | List of items to add to collection
api.addSoundboxItems(id, body)
.then(function() {
console.log('API called successfully.');
})
.catch(function(error) {
console.error(error);
});
const sstk = require('shutterstock-api');
sstk.setAccessToken(process.env.SHUTTERSTOCK_API_TOKEN);
const audioApi = new sstk.AudioApi();
const collectionId = "48433115";
const body = {
"items": [
{
"id": "442583"
},
{
"id": "7491192"
}
]
};
audioApi.addSoundboxItems(collectionId, body)
.then(function() {
console.log("Success!");
})
.catch(function(error) {
console.error(error);
});
```


### Parameters


@@ -90,26 +98,26 @@ This endpoint creates one or more collections (soundboxes). To add tracks, use &
### Example

```javascript
const sstk = require('shutterstock-api');
// To use OAuth access token authorization:
sstk.setAccessToken(process.env.SHUTTERSTOCK_API_TOKEN);
const api = new sstk.AudioApi();
const body = new ShutterstockApiReference.CollectionCreateRequest(); // CollectionCreateRequest | Collection metadata
api.createSoundbox(body)
.then(function(data) {
console.log(data);
})
.catch(function(error) {
console.error(error);
const sstk = require('shutterstock-api');
sstk.setAccessToken(process.env.SHUTTERSTOCK_API_TOKEN);
const audioApi = new sstk.AudioApi();
const body = {
"name": "Best rock music"
};
audioApi.createSoundbox(body)
.then(function() {
console.log("Success!");
})
.catch(function(error) {
console.error(error);
});
```


### Parameters


@@ -151,26 +159,24 @@ This endpoint deletes a collection.
### Example

```javascript
const sstk = require('shutterstock-api');
// To use OAuth access token authorization:
sstk.setAccessToken(process.env.SHUTTERSTOCK_API_TOKEN);
const api = new sstk.AudioApi();
const id = "\"48433111\""; // String | Collection ID
api.deleteSoundbox(id)
.then(function() {
console.log('API called successfully.');
})
.catch(function(error) {
console.error(error);
const sstk = require('shutterstock-api');
sstk.setAccessToken(process.env.SHUTTERSTOCK_API_TOKEN);
const audioApi = new sstk.AudioApi();
const collectionId = "48433107";
audioApi.deleteSoundbox(collectionId)
.then(function() {
console.log("Success!");
})
.catch(function(error) {
console.error(error);
});
```


### Parameters


@@ -207,29 +213,32 @@ This endpoint removes one or more tracks from a collection.
### Example

```javascript
const sstk = require('shutterstock-api');
// To use OAuth access token authorization:
sstk.setAccessToken(process.env.SHUTTERSTOCK_API_TOKEN);
const api = new sstk.AudioApi();
const id = "\"48433119\""; // String | Collection ID
const queryParams = {
'item_id': ["[ \"76688182\", \"40005859\" ]"] // [String] | One or more item IDs to remove from the collection
};
api.deleteSoundboxItems(id, queryParams)
.then(function() {
console.log('API called successfully.');
})
.catch(function(error) {
console.error(error);
const sstk = require('shutterstock-api');
sstk.setAccessToken(process.env.SHUTTERSTOCK_API_TOKEN);
const audioApi = new sstk.AudioApi();
const collectionId = "";
// Array of tracks to remove
const tracksToRemove = {
item_id: [
"76688182",
"40005859"
]
};
audioApi.deleteSoundboxItems(collectionId, tracksToRemove)
.then(function() {
console.log("Success!");
})
.catch(function(error) {
console.error(error);
});
```


### Parameters


@@ -267,26 +276,25 @@ This endpoint redownloads tracks that you have already received a license for.
### Example

```javascript
const sstk = require('shutterstock-api');
// To use OAuth access token authorization:
sstk.setAccessToken(process.env.SHUTTERSTOCK_API_TOKEN);
const api = new sstk.AudioApi();
const id = "\"i1188641348\""; // String | License ID
api.downloadTracks(id)
.then(function(data) {
console.log(data);
})
.catch(function(error) {
console.error(error);
});
const sstk = require('shutterstock-api');
sstk.setAccessToken(process.env.SHUTTERSTOCK_API_TOKEN);
const audioApi = new sstk.AudioApi();
const licenseId = ''; // license ID, not track ID
audioApi.downloadTracks(licenseId)
.then(function(data) {
console.log(data);
})
.catch(function(error) {
console.error(error);
});
```


### Parameters


@@ -946,30 +954,34 @@ This endpoint gets licenses for one or more tracks.
### Example

```javascript
const sstk = require('shutterstock-api');
// To use OAuth access token authorization:
sstk.setAccessToken(process.env.SHUTTERSTOCK_API_TOKEN);
const api = new sstk.AudioApi();
const body = new ShutterstockApiReference.LicenseAudioRequest(); // LicenseAudioRequest | Tracks to license
const queryParams = {
'license': "audio_standard", // String | License type
'search_id': "search_id_example" // String | The ID of the search that led to licensing this track
};
api.licenseTrack(body, queryParams)
.then(function(data) {
console.log(data);
})
.catch(function(error) {
console.error(error);
const sstk = require('shutterstock-api');
sstk.setAccessToken(process.env.SHUTTERSTOCK_API_TOKEN);
const audioApi = new sstk.AudioApi();
const body = {
"audio": [
{
"audio_id": "446348",
"license": "premier_music_comp",
"metadata": {
"purchase_order": "123"
}
}
]
};
audioApi.licenseTrack(body)
.then(function({data}) {
console.log(data);
})
.catch(function(error) {
console.error(error);
});
```


### Parameters


@@ -1018,28 +1030,29 @@ This endpoint sets a new name for a collection.
### Example

```javascript
const sstk = require('shutterstock-api');
// To use OAuth access token authorization:
sstk.setAccessToken(process.env.SHUTTERSTOCK_API_TOKEN);
const api = new sstk.AudioApi();
const id = "\"48433107\""; // String | Collection ID
const body = new ShutterstockApiReference.CollectionUpdateRequest(); // CollectionUpdateRequest | Collection changes
api.renameSoundbox(id, body)
.then(function() {
console.log('API called successfully.');
})
.catch(function(error) {
console.error(error);
});
const sstk = require('shutterstock-api');
sstk.setAccessToken(process.env.SHUTTERSTOCK_API_TOKEN);
const audioApi = new sstk.AudioApi();
const collectionId = "48433107";
const body = {
"name": "Best rock music"
};
audioApi.renameSoundbox(collectionId, body)
.then(function() {
console.log("Success!");
})
.catch(function(error) {
console.error(error);
});
```


### Parameters


@@ -519,26 +519,33 @@ This endpoint gets licenses for one or more editorial images. You must specify t
### Example

```javascript
const sstk = require('shutterstock-api');
// To use OAuth access token authorization:
sstk.setAccessToken(process.env.SHUTTERSTOCK_API_TOKEN);
const api = new sstk.EditorialApi();
const body = new ShutterstockApiReference.LicenseEditorialContentRequest(); // LicenseEditorialContentRequest | License editorial content
api.licenseEditorialImage(body)
.then(function(data) {
console.log(data);
})
.catch(function(error) {
console.error(error);
});
const sstk = require('shutterstock-api');
sstk.setAccessToken(process.env.SHUTTERSTOCK_API_TOKEN);
const api = new sstk.EditorialApi();
const body = {
editorial: [
{
editorial_id: "8594090h",
license: "premier_editorial_comp"
}
],
country: "USA"
};
api.licenseEditorialImage(body)
.then(function({data}) {
console.log(data);
})
.catch(function(error) {
console.error(error);
});
```


### Parameters


Oops, something went wrong.

0 comments on commit 1ea3560

Please sign in to comment.
You can’t perform that action at this time.