Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
aweber-api-nodejs
Advanced tools
This library was created to provide Oauth and API request functionality between NodeJS applications and the Aweber API.
#Integrate AWeber with Your NodeJS Application
This library was created to provide Oauth and API request functionality between NodeJS applications and the Aweber API.
You'll also find a complete, working sample application running express in example.js. Install express using npm
, I intentionally left it out of the project dependencies.
To run the example app:
consumer_key=YOUR_KEY consumer_secret=YOUR_SECRET node example.js
I didn't find the node OAuth libraries to be useful. I only needed the request signing and parameter encoding, so I implemented just that. Here's how to perform each piece of the process.
This is the URL Aweber will send the user back to during each step of the process.
var NodeAweber = require('aweber-api-nodejs');
var NA = new NodeAweber(CONSUMER_KEY, CONSUMER_SECRET, CALLBACK_URL);
NA.requestToken(callback);
Note that all variables for this request will be generated automatically. This will give you an oauth_token
and oauth_token_secret
you'll need in the next steps.
After getting the request token, authorizing it is as simple as redirecting the user to this URL:
https://auth.aweber.com/1.0/oauth/authorize?oauth_token=OAUTH_TOKEN_FROM_CALLBACK
After the user enters their details, they'll be redirected to your application, this time via a GET request with the following query params:
oauth_verifier
oauth_token
Now, generate the access token:
var accessToken = NA.accessToken(oauth_token, oauth_verifier, token_secret_from_earlier, callback);
...And you'll now have an oauth_token_secret
and oauth_token
you can use for further requests!
var apiClient = NA.api(token, tokenSecret);
apiClient.request('get', 'accounts', {}, function(err, response){
var accounts = response.entries;
var listsUrl = 'accounts/'+accounts[0].id+'/lists';
apiClient.request('get', listsUrl, {}, function(err, response){
apiClient.request('post', listsUrl+'/'+response.entries[0].id+'/subscribers', {
'ws.op': 'create',
'email': 'justatestemail000000zzz@gmail.com'
}, function(err, response){
if(response.status == 201){
res.send('subscriber added to list.');
} else {
res.send(JSON.stringify(response));
}
});
});
});
FAQs
This library was created to provide Oauth and API request functionality between NodeJS applications and the Aweber API.
The npm package aweber-api-nodejs receives a total of 742 weekly downloads. As such, aweber-api-nodejs popularity was classified as not popular.
We found that aweber-api-nodejs demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.