Methods
static getAuthor(client, authorId) → {Promise.<(Author|null)>}
This method fetches an author by Id. See the example on Author for usage.
Parameters:
Name | Type | Description |
---|---|---|
client |
Client | |
authorId |
number |
- See:
-
- GET /api/v1/authors/:author-id API documentation for a list of parameters and fields
static getAuthorCollection(client, authorId) → {Object}
This method fetches the collection. See the example on Author for usage.
Please note, this function does not return a Collection object, but a plain javascript object.
Parameters:
Name | Type | Description |
---|---|---|
client |
Client | |
authorId |
number |
- Deprecated:
- This will be deprecated in favor of a method which returns a Collection.
Please see API documentation for more details
static getAuthors(client, params)
This method can be used to fetch all authors across the site. Use of this API is highly discouraged as you will need to make multiple calls to fetch all authors, as authors grow.
Parameters:
Name | Type | Description |
---|---|---|
client |
Client | |
params |
Object | |
limit |
number | Number of authors to be returned (default 20) |
offset |
number | Number of authors to skip |
- Deprecated:
- This API is very slow if there are more than ~100 authors.
asJson()
Use this to convert to a simple javascript object, suitable for JSON.