buffer-node
buffer-node is a Node.js API Client for Buffer
Installation
$ npm install buffer-node
Usage
Buffer-node offers an easy to use wrapper for the Buffer API.
Example:
var bufferAPI = api = apiuser
Authentication
Buffer uses OAuth 2.0 for authorization. It is recommended to use a library such as Passport to authorize and retrieve an access token for the user.
Client creation
When requiring the buffer-node module, a factory function for the API client will be exposed. Simply pass an access token and the ready to use client will be returned.
var bufferAPI = api =
Requests
API requests always return a promise using the promise module. You should then use one of the supplied methods to handle successful calls and errors.
API functions
The API client completely covers the available Buffer API endpoints. Some methods can take optional parameters as an object. The keys and values correspond to the parameter specified in the API documentation.
When passing dates, the API client will automatically convert JavaScript Date instances to the right format.
User
Retrieve a single Buffer user account.
apiuser
Profiles
Retrieve the social media profiles associated with the current user account.
apiprofiles
Retrieve a single social media profile.
apiprofile'<profile ID>'
Schedules
Retrieve schedules associated with a social media profile.
apiprofile'<profile ID>'schedules
Update schedules.
- schedules array of schedules
[{days: ['mon', 'fri'], times: ['08:00', '15:00']}]
apiprofile'<profile ID>'schedules
Updates
Retrieve pending updates for a social media profile.
- options page, count, since, utc
apiprofile'<profile ID>'updates
Retrieve sent updates for a social media profile.
- options page, count, since, utc
apiprofile'<profile ID>'updates
Retrieve a single update.
api
Retrieve social media interaction for a single update.
- event type of event
- options count, page
api
Reorder updates for a single social media profile.
- order Array of update IDs
- options offset, utc
apiprofile'<profile ID>'updates
Shuffle updates for a single social media profile.
- options count, utc
apiprofile'<profile ID>'updates
Create a new update.
- text Update text
- profileIds Array of profile IDs
- options shorten, now, top, media, attachment, scheduled_at
apiupdates
Modify an existing update.
- text Update text
- options now, media, utc, scheduled_at
api
Immediately share an existing update.
api
Delete an existing update.
api
Move an existing update to the top of the Buffer queue.
api
Links
Get number of shares for a link on Buffer.
- url URL of the link
api.links.shares(url)
Info
Get configuration Buffer is using for its social media profiles.
apiinfo