Loading ...
edocr
Technology & Engineering
Blog Posts
445
5
requesting
Try Now
Log In
Pricing
edocr Public API Reference About the edocr API The edocr public API allows you to access information about documents and users. This section provides some general information about using the edocr API: ● Prerequisites ● Authentication ● HTTP Status Codes Prerequisites To access the API, you need an API key, which is only available to paid/premium accounts. You can generate your key under Account Settings > Integrations > API Integration. Authentication Authentication is performed by passing the API key, by either setting the apikey header in the HTTP request, or using the apikey query parameter. HTTP Status Codes ● 200 - OK The response body will be as outlined below based on the specific request type. ● 401 - Unauthorized All requests require apikey as either a query parameter or in the request header. If no API key is provided, or if the API key provided is invalid, the request will be rejected with HTTP status 401, with response body {"errorCode": "Unauthorized"} ● 403 - Forbidden If a request is made for an item to which the requesting user does not have access (e.g., requesting another user's private document), the API will return HTTP status 403 with response body {"errorCode": "Forbidden" } ● 404 - NotFound If the requested item is not found, it will return HTTP status 404, with response body {"errorCode": "NotFound"} ● 580 - [varied] If some other unexpected error occurs, the API will return a status 580, with a similar response body as the above examples, but the errorCode will vary depending on the cause. API Reference The edocr public API allows you to access information about Documents and Users. Documents You can do the following: ● Get User Document Count ● Get User Document List ● Get Single Document ● Get Document Analytics Get User Document Count /api/v1/users/:userguid/documents/count /api/v1/users/current/documents/count (user identified by API key) Sample Output: { “count”: 42 } Get User Document List /api/v1/users/:userguid/documents /api/v1/users/current/documents (user identified by API key) Sample Output: [ { "guid": "79edw4e7", "title": "Lorem ipsum dolor", "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam. Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris. Fusce nec tellus sed augue semper porta. Mauris massa. Vestibulum lacinia arcu eget nulla.", "visibility": "leads", "category": { "id": 3, "name": "Business & Jobs" }, "collection": { "id": 337019, "name": "Research Documents" }, "published": "2016-07-14T20:43:36.000Z", "thumbnail": "http://lorempixel.com/400/200/cats/" }, { "guid": "xrygk3dv", "title": "An Astounding Work of Fiction", "description": "This novel is the best book ever.", "visibility": "marketplace", "category": { "id": 11, "name": "Literature" }, "published": "2016-07-13T22:42:00.000Z", "thumbnail": "http://lorempixel.com/400/200/cats/" }, { "guid": "qp24yzql", "title": "My Cat", "description": "My cat is fuzzy.", "visibility": "public", "category": { "id": 28, "name": "Nature" }, "published": "2016-02-25T15:46:38.000Z", "thumbnail": "http://lorempixel.com/400/200/cats/" } ] Attribute Description Values guid Globally unique identifier that identifies a share. Alphanumeric title Title of the document. Text description Description/summary of the document contents. Text; limited support for HTML tag formatting visibility Describes the visibility of the document. public - any user can view the document leads - only users who have agreed to share their email may view the document marketplace - only users who purchase the document may view it link - Only users who have the unique private URL may view the document group - Only users who the document have explicitly been shared with may view the document. category The category id and name in which the document has been placed. id: numeric name: text collection (optional) The user collection id and name in which the document was published, if applicable. id: numeric name: text thumbnail Points to document thumbnail image. URL Get Single Document /api/v1/documents/:documentGuid The output format is the same as for get user document list, but returns a single JSON object representing the requested document, rather than a list. Get Document Analytics /api/v1/documents/:documentGuid/analytics For a given document, returns analytics counts by date. Analytics include views, document downloads (if enabled), and social sharing counts (Twitter, Facebook, LinkedIn, Google+, reddit, Tumblr, Pinterest, or email). Sample Output: [ { "view": 1, "date": "2016-05-12" }, { "view": 2, "date": "2016-05-19" }, { "download": 1, "share": { "twitter": 1 }, "date": "2016-07-12" } ] Users You can Get User information. Get User You can retrieve a user’s public information using multiple methods: ● To get the user associated with the API key, use: /api/v1/users/current (user identified by API key) ● If you know a specific user’s GUID, you can use: /api/v1/users/:userguid ● You can also search for a user by their email address, if they have shared it as part of their public profile. (NOTE: to protect privacy, it will not find users by their login email address.) /api/v1/users?email=foo@bar.com ● Finally, if you know the edocr user name, you can search by that as well: /api/v1/users?userName=xxxxxx Sample Output: { "guid": "0C3BB609-1E40-4B1D-9D4D-667F9049D1A9", "userName": "edocrUser", "displayName": "edocr user", "logo": "http://lorempixel.com/400/200/cats/", "bio": "<p>This is a paragraph of text all about me</p>", "contact": { "address": "123 Main St", "address2": "Suite 1337", "city": "Tampa", "state": "FL", "postalCode": "33601", "country": "US", "phone": "8135551212", "email": "foo@bar.com", "facebook": "https://www.facebook.com/accusoft", "twitter": "edocr" } }