![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
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.
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
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.