Library to easy access and use dribbble OAuth2 api.
Getting Started
constsettings={'client_id': YOUR_CLIENT_ID,'client_secret': YOUR_CLIENT_SECRET};constdribble=require('./dribbble-oauth2/index')(settings);// return instance of dribble (singleton)
Dribbble instance can init later. Just call setSettings mehtod/
constdribble=require('dribbble-oauth2')();// ... another code constsettings={'client_id': YOUR_CLIENT_ID,'client_secret': YOUR_CLIENT_SECRET};dribble.setSettings(settings);consturl=dribble.authorize(REDIRECT_URL,'public+upload');
Init dribble and set local url when you will get code (note, redirect url should be save in a dribble account)
Scope can be 'public', 'upload' or 'public+upload';
consturl=dribble.authorize(redirectUrl,scope);// return link (type = string);
Go to link returned from the authorize method and login into Dribbble using your credentials.
After this you will be redirected to the setted url.
Use code in params and get the access_token.
app.get('/redirect',(req,res)=>{// Example routeconstcode=req.query.code;// Get the code from url paramsdribble.getToken(code).then(response=>{if(response.status){res.json(response.statusText)}else{res.json(response)// Contains an access_token which you can use in future requests}});});
Required. The image file must be exactly 400x300 or 800x600 resolution, no larger than 8 megabytes, and be a GIF, JPG or PNG.
title
string
Required. The title of the shot.
description
string
The shot description.
low_profile
boolean
Specify true if the shot is Low Profile.
rebound_source_id
integer
An ID of a shot that the new shot is a rebound of.
The authenticated user must either be a member of the team or be authenticated as the same team.
dribble.api.shot.create(settings);
Update a shot
Name
Type
Description
id
number
Shot Id.
description
string
Shot description.
low_profile
boolean
Specify true if the shot is Low Profile.
scheduled_for
timestamp
If the shot is not already published, will reschedule the shot to publish at the timestamp provided. Timestamp must be in ISO 8601 format. The authenticated user must be a pro, a team, or a member of a team.
tags
array
Tags for the shot. Limited to a maximum of 12 tags. If any existing tags are not provided they will be removed.
team_id
integer
An ID of a team to associate the shot with. The authenticated user must be on the team. If any empty value is provided the team association will be removed.
title
string
The title of the shot.
dribble.api.shot.update(id,settings);
Delete shot by id
Name
Type
Description
id
number
Shot id.
dribble.api.shot.delete(id);
User
Get the authenticated user
dribble.api.user.get();
Projects
List projects
dribble.api.project.getAll();
Create a project
Name
Type
Description
name
string
Required. The name of the project.
description
string
The project description.
dribble.api.project.create(settings);
Update a project
Name
Type
Description
id
number
Project id.
name
string
The name of the project.
description
string
The project description.
dribble.api.project.update(id,settings);
Delete a project
Name
Type
Description
id
number
Project id.
dribble.api.user.delete(id);
Attachments
Create an attachment
Name
Type
Description
file
file
Required. The attachment file must be no larger than 10 megabytes.