Constructor
new Instagram(optionsopt)
Create an instance.
Authorization options can later be set
with call to Instagram#setAuth
.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
Instance options. Properties
|
- Source:
Methods
getAuth() → {Object}
Get current authorization parameters.
- Source:
Returns:
Current authorization parameters.
- Type
- Object
getAuthorizationUrl(redirectUri, optionsopt) → {string}
Generate authorization URL.
For more information see Instagram Authentication.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
redirectUri |
string | Redirect URI |
|||||||||||||
options |
Object |
<optional> |
Additional query parameters. Properties
|
- Source:
Returns:
An authorization URL.
- Type
- string
request(method, path, optionsopt) → {Promise.<Object>}
Create request.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
method |
string | HTTP method. |
|
path |
string | Resource path. |
|
options |
Object |
<optional> |
Request options passed to Got |
- Source:
Returns:
A promise resolving to response object.
- Type
- Promise.<Object>
requestAccessToken(code, redirectUri) → {Promise.<Object>}
Exchange authorization code for access token.
Parameters:
Name | Type | Description |
---|---|---|
code |
string | Authorization code received from service. |
redirectUri |
string | Redirect URI. |
- Source:
Throws:
Returns:
Response containing access token.
- Type
- Promise.<Object>
setAuth(options) → {Instagram}
Set authorization parameters.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object | Authorization parameters. Properties
|
- Source:
Returns:
This instance.
- Type