Class: Scribd

node-scribd-client~ Scribd

new Scribd(api_key, secret) → {object}

Parameters:
Name Type Description
api_key string your api key from scribd
secret string your secret from scribd
Source:
Returns:
scribd client instance
Type
object

Methods

addDocToCollection(params, callback) → {object}

This method adds a document to an existing collection. Will return a blank OK response object if successful.
Parameters:
Name Type Description
params object param wrapper object
callback function the function you want called in response to this API call
Properties:
Name Type Description
params.doc_id number | string The Doc id
params.collection_id number | string The id of the collection. This can be obtained with a call to getCollections.
Source:
Returns:
an object containing the stat property
Type
object

browse(params, callback) → {object}

This method returns a list of documents that meet filter criteria.
Parameters:
Name Type Description
params object param wrapper object
callback function the function you want called in response to this API call
Properties:
Name Type Argument Description
params.limit number | string <optional>
Number of results to return: Default 20, max 1000.
params.offset boolean | string <optional>
Number to start at: Default 1. Cannot exceed 1000.
params.category_id number | string <optional>
A category ID to search documents in.
params.sort string <optional>
Sort order. Set to "popular" by default.
Source:
Returns:
an object containing the result_set object.
Type
object

changeSettings(params, callback) → {object}

This method updates the meta-data for existing documents. Only send arguments for fields you would like to overwrite. Will return a blank response object if succesful
Parameters:
Name Type Description
params object param wrapper object
callback function the function you want called in response to this API call
Properties:
Name Type Argument Description
params.doc_ids Array.<string> array of document id strings
params.title string <optional>
title of document
params.description string <optional>
description of document
params.access string <optional>
private, or public
params.license string <optional>
"by", "by-nc", "by-nc-nd", "by-nc-sa", "by-nd", "by-sa", "c" or "pd"
params.show_ads array <optional>
default, true, or false
params.tags array <optional>
list of tags
Source:
Returns:
an empty object.
Type
object

createCollection(params, callback) → {object}

This method creates a new collection. Will return an OK response collection_id and collection_type.
Parameters:
Name Type Description
params object param wrapper object
callback function the function you want called in response to this API call
Properties:
Name Type Argument Description
params.name string The name of the collection.
params.description string <optional>
The description of the collection.
params.privacy_type string <optional>
This specifies the privacy type of the collection. This value can either be "public" or "private". If not included, the collection will default to "public."
Source:
Returns:
an object containing the collection_id and privacy_type
Type
object

delete(params, callback) → {object}

This method deletes an existing document. Will return a blank OK response object if successful.
Parameters:
Name Type Description
params object | string param wrapper object or the doc_id string
callback function the function you want called in response to this API call
Properties:
Name Type Description
params.doc_id number | string the document id
Source:
Returns:
an empty object
Type
object

deleteCollection(params, callback) → {object}

This method deletes new collection. Will return a blank OK response object if successful.
Parameters:
Name Type Description
params object param wrapper object
callback function the function you want called in response to this API call
Properties:
Name Type Description
params.collection_id number | string The id of the collection.
Source:
Returns:
an object containing the stat property
Type
object
This method returns a list of featured documents.
Parameters:
Name Type Description
params object param wrapper object
callback function the function you want called in response to this API call
Properties:
Name Type Argument Description
params.limit number | string <optional>
Number of results to return: Default 20, max 1000.
params.offset boolean | string <optional>
Number to start at: Default 0. Cannot exceed 1000.
params.scope string <optional>
Whether to search new documents or hot only. Set to "hot" by default.
Source:
Returns:
an object containing the result_set object.
Type
object

getAutoSigninUrl(params, callback) → {object}

This method returns a URL that, when visited, will automatically sign in the given user account and then redirect to the URL you provide. The URL expires after 7 days
Parameters:
Name Type Description
params object param wrapper object
callback function the function you want called in response to this API call
Properties:
Name Type Description
params.next_url string The URL or path portion of a Scribd URL to redirect to. Set to blank for home page.
Source:
Returns:
an object containing the auto-signin URL prop named url
Type
object

getCategories(params, callback) → {object}

This method returns a list of categories or subcategories.
Parameters:
Name Type Description
params object param wrapper object
callback function the function you want called in response to this API call
Properties:
Name Type Argument Description
params.category_id number | string <optional>
The ID of category to retrieve children for. If none - all root categories will be returned.
params.with_subcategories boolean | string <optional>
Include subcategories in results.
Source:
Returns:
an object containing the result_set object.
Type
object

getCollectionList(params, callback) → {object}

This method retrieves a list of collections for a given user.
Parameters:
Name Type Description
params object param wrapper object
callback function the function you want called in response to this API call
Properties:
Name Type Argument Description
params.scope string <optional>
This specifies the privacy type of the collections that are returned. This value can either be "public" or "private. If not included, all document collections are returned.
Source:
Returns:
an object containing the result_set
Type
object

getConversionStatus(params, callback) → {object}

This method retrieves the conversion status of the document.
Parameters:
Name Type Description
params object | string param wrapper object or the doc_id string
callback function the function you want called in response to this API call
Properties:
Name Type Description
params.doc_id number | string the document id
Source:
Returns:
object containing "DISPLAYABLE", "DONE", "ERROR", or "PROCESSING" for the current document.
Type
object

getDownloadUrl(params, callback) → {object}

This method returns a link you can use to download a static version of a document.
Parameters:
Name Type Description
params object param wrapper object
callback function the function you want called in response to this API call
Properties:
Name Type Description
params.doc_id string | number Document ID of the file to download. You must have ownership of this document.
params.doc_type string The type of file to download. If "original", will get a link to the original file uploaded, regardless of its extension.
Source:
Returns:
an object containing a link to the file
Type
object

getList(callback) → {object}

This method retrieves a list of documents for a given user.
Parameters:
Name Type Description
callback function the function you want called in response to this API call
Source:
Returns:
containing doc_id, title, description, access_key, and conversion_status for all documents for a given user
Type
object

getSettings(params, callback) → {object}

This method retrieves the meta-data for existing documents.
Parameters:
Name Type Description
params object | string param wrapper object or the doc_id string
callback function the function you want called in response to this API call
Properties:
Name Type Description
params.doc_id number the document id
Source:
Returns:
an object containing doc_id, title , description , access, tags, show_ads, license, access_key, secret_password
Type
object

getStats(params, callback) → {object}

This method retrieves statistics of the document.
Parameters:
Name Type Description
params object | string param wrapper object or the doc_id string
callback function the function you want called in response to this API call
Properties:
Name Type Description
params.doc_id number | string the document id
Source:
Returns:
an object containing a single property "reads" with the number numb of reads.
Type
object

getThumb(params, callback) → {object}

This method retrieves a URL to the thumbnail of a document, in a given size.
Parameters:
Name Type Description
params object param wrapper object
callback function the function you want called in response to this API call
Properties:
Name Type Argument Description
params.doc_id number | string The ID of the document. It must be a public document, or one that your account controls.
params.width number | string <optional>
Width in px of the desired image. If not included, will use the default thumb size.
Source:
Returns:
an object containing the thumbnail_url property.
Type
object

listCollectionDocs(params, callback) → {object}

This method retrieves a list of documents in a given collection.
Parameters:
Name Type Description
params object param wrapper object
callback function the function you want called in response to this API call
Properties:
Name Type Argument Description
params.collection_id number | string The id of the collection.
params.limit number | string <optional>
The id of the collection.
params.offset number | string <optional>
The offset into the list of documents. You can paginate through the full list using the limit and offset parameters.
Source:
Returns:
an object containing the result_set
Type
object

login(params, callback) → {object}

This method allows your API application to sign in as an existing Scribd user, executing methods as that user.
Parameters:
Name Type Description
params object param wrapper object
callback function the function you want called in response to this API call
Properties:
Name Type Description
params.username string username of user to log in
params.password string password of user to log in
Source:
Returns:
an object containing session_key, name, username, and user_id of the user
Type
object

removeDocFromCollection(params, callback) → {object}

This method removes a document from an existing collection. Will return a blank OK response object if successful.
Parameters:
Name Type Description
params object param wrapper object
callback function the function you want called in response to this API call
Properties:
Name Type Description
params.doc_id number | string the Doc id to remove
params.collection_id number | string The id of the collection.
Source:
Returns:
an object containing the stat prop
Type
object
This method searches for the specified query in the public documents on Scribd.com. Private documents are not searchable.
Parameters:
Name Type Description
params object | string param wrapper object or the doc_id string
callback function the function you want called in response to this API call
Properties:
Name Type Argument Description
params.query string search query
params.num_results number <optional>
number of results to return (10 default, 1000 max)
params.num_start number <optional>
number to start from
params.category_id number <optional>
Restricts search results to only documents in a certain category.
params.language string <optional>
Restricts search results to only documents in the specified language (in ISO 639-1 format).
pararms.simple boolean <optional>
This option specifies whether or not to allow advanced search queries
Source:
Returns:
results objects, each of which contain doc_id, secret password, access_key, title, and description and other meta data
Type
object

signup(params, callback) → {object}

This method allows your API application to signup a new Scribd user. If the signup is successful, your application will be passed back a session key which will allow you to execute methods on behalf of the new user.
Parameters:
Name Type Description
params object param wrapper object
callback function the function you want called in response to this API call
Properties:
Name Type Description
params.username string username of user to log in
params.password string password of user to log in
params.email string email address of user
params.name string name of user
Source:
Returns:
an object containing session_key, name, username, and user_id of the user
Type
object

updateCollection(params, callback) → {object}

This method updates a new collection's name, description or privacy_type. Will return an OK response collection_id and changed attributes and their corresponding values.
Parameters:
Name Type Description
params object param wrapper object
callback function the function you want called in response to this API call
Properties:
Name Type Argument Description
params.collection_id number | string The id of the collection.
params.name string <optional>
The name of the collection. When present, it cannot be blank or a string containing only whitespaces.
params.description string <optional>
The description of the collection.
Source:
Returns:
an object containing the collection_id and changed attributes
Type
object

upload(params, callback) → {object}

This method accepts the document file via Multi-Part POST.
Parameters:
Name Type Description
params object param wrapper object
callback function the function you want called in response to this API call
Properties:
Name Type Argument Description
params.file string relative path to file
params.doc_type string <optional>
PDF, DOC, TXT, PPT, etc.
params.access string <optional>
public or private. Default is Public.
params.rev_id number <optional>
id of file to modify
Source:
Returns:
an object containing doc_id, access_key, and secret_password if nessesary.
Type
object

uploadFromUrl(params, callback) → {object}

This method retrieves the document file from the specified URL.
Parameters:
Name Type Description
params object param wrapper object
callback function the function you want called in response to this API call
Properties:
Name Type Description
params.url string absolute URL of file
params.doc_type string : PDF, DOC, TXT, PPT, etc.
params.access string public or private. Default is Public.
params.rev_id number id of file to modify
Source:
Returns:
an object containing doc_id, access_key, and secret_password if nessesary.
Type
object

uploadThumb(params, callback) → {object}

This method accepts a document thumbnail file via Multi-Part POST.
Parameters:
Name Type Description
params object param wrapper object
callback function the function you want called in response to this API call
Properties:
Name Type Description
params.file string relative path to file
params.doc_id number | string The doc_id to attach the uploaded thumbnail to.
Source:
Returns:
an object containing the stat property.
Type
object