Back to top

This is the DDP API documentation for the Fetching bookmarking and search service. There is a separate REST API also available.

Note: the Fetching API is currently in Beta. It’s interfaces are subject to change and its performance may be variable.

Authentication

All DDP connections must be authenticated to a specific, active user account. Both Fetching Cloud and Cloud Sync accounts can be accessed via the API. Fetching Native does not provide API access at this time.

Access Tokens

All DDP connections must be authenticated using a valid API Token. To get an API token for your account please visit the Fetching API Settings page.

Access Levels

API access can be either read-only or read-write.

Use read-only access when you need to make your API tokens public such as in a JavaScript widget running in a browser. These tokens will grant read access to your account data, do not allow any changes to be made, and restrict document queries to bookmarked pages only.

Use read-write access only when you can keep your token private such as on a secure server. These tokens allow modifications to your data and allow access to all your document data, including potentially sensitive browsing data in addition to your bookmarks.

Errors

The common HTTP Response Status Codes are used.

API Base 

ALl DDP clients must first connect to the base API endpoint before logging-in, calling methods, or subscribing to publications.

DDP Connect 

Connect
/

    Authentication 

    Before subscribing or calling any methods, DDP connections must login using a valid API token.

    DDP Login 

    Authenticate a connection
    /login

    Authenticate a connection.

    • Parameters
    • apiToken
      string (required) 

      A valid API token.

    • Request
    • Body
      login, {apiToken: 'E031EIDrgUXMmJtxE4dfrHN_8kHx3w_Cot3tlspMJoa'}
      

    Documents 

    The Documents DDP API let’s you subscribe to receive change information on individual documents and collections of documents. Note that as document are added and removed from the index, they do not get added to active subscriptions.

    Document Collection 

    Subscribe to a collection of Documents
    /documents

    Receive updates when any documents in a collection change.

    • Parameters
    • limit
      integer (optional) 

      Limit the number of documents returned. Defaults to 10.

      token
      string (optional) 

      A valid authentication token.

      query
      string (optional) 

      A valid search query.

      scope
      string (optional) 

      The search scope, one of either bookmarked or all. Defaults to all.

    • Request
    • Body
      'subscribe', {limit: 10, query: 'apple'}
      

    Document 

    Subscribe to a Document
    /document

    Receive updates when a single document is changed.

    • Parameters
    • id
      string (required) 

      The ID of an existing document.

    • Request
    • Body
      'subscribe', 'UXMmJtxE4dfr'
      

    Generated by aglio on 11 Oct 2015