Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-snapchat-marketing

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-snapchat-marketing - npm Package Compare versions

Comparing version 1.0.12 to 1.0.13

2

package.json

@@ -56,3 +56,3 @@ {

},
"version": "1.0.12"
"version": "1.0.13"
}
# Snapchat Marketing Node.js Wrapper
:ghost: Unoffical Node library for the Snapchat Marketing API
### Looking for more contributors!
[Snapchat Marketing API Documentation](https://developers.snapchat.com/api/docs/)
## Installation
## :wrench: Installation
Before you begin, you need to register your app in the [Snapchat developer dashboard](https://developers.snapchat.com/ads/). Notice that the app gets a client ID, secret, and redirect URI required for authenticating with the API.
Before you begin, you need to apply for access to the [Snapchat Marketing API](https://developers.snapchat.com/apply/). Once you are approved, you will be able to register a new application in the 'Business Details' section of your [Snapchat Business Account](https://business.snapchat.com/). Notice that the app gets a client ID, secret, and redirect URI required for authenticating with the API.
If you reach an error page when trying to access your Business Account, try disabling any ad-blockers you might have.
After registering your application, you need to install this module in your Node.js project:

@@ -16,3 +19,3 @@

## Initialization
## :arrow_forward: Initialization

@@ -35,3 +38,3 @@ In order to use this module, you have to import it in your application first:

## Authenticating
## :key: Authenticating

@@ -42,3 +45,3 @@ To make HTTP calls, you need to create an authenticated session with the API.

To obtain an OAuth 2 bearer token, you have to authorize your application with the required scope. The only scope currently available is 'snapchat-marketing-api'.
To obtain an OAuth token, you have to authorize your application with the required scope. The only scope currently available is 'snapchat-marketing-api'.

@@ -61,3 +64,3 @@ You are initially required to redirect your user to an authorization URL. You can generate the authorization URL using `snap.getAuthorizeUrl`. In case you are using [Express](http://expressjs.com/), your route definition could look as follows:

Using Express, you could achieve that as follows:
In Express - If your 'redirect_uri' is https://example.com/snap/callback, your route could look like:

@@ -68,3 +71,3 @@ ```javascript

console.log("Access token is: " + token.access_token);
console.log("Refresh token is: " + token.access_token);
console.log("Refresh token is: " + token.refresh_token);
console.log("Access token expires in: " + token.expires_in + " seconds");

@@ -85,3 +88,3 @@ res.redirect('/');

Now that you are authenticated, you can issue requests using provided methods.
Now that you are authenticated, you can issue requests using the provided library methods.

@@ -91,3 +94,2 @@ For instance, to obtain a list of all available organizations associated with your account, you can use `snap.organization.getAllOrganizations`.

```javascript
snap.organization.getAllOrganizations(function(err, orgs)

@@ -101,3 +103,3 @@ {

```
## Library Methods
## :books: Library Methods

@@ -116,3 +118,3 @@ ### Authorization

- Use 'snapchat-marketing-api' as your scope.
- Currently, the only available scope is 'snapchat-marketing-api'.

@@ -226,3 +228,3 @@ ##### Example

}
snap.media.createMedia(newMedia, function(err, res){

@@ -257,3 +259,1 @@ if(err)

```
#### Looking for more contributors!
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc