Lifecycle of a /send request
With the send endpoint, the user only needs to supply consumer_key and
access_token. And the app should automatically return all the items
that belong to that user.
Optional filteres can be added, but for the sake of simplicity, we will deal with them later.
- consumer_key
- access_token
Now we cannot do anything with consumer_key yet.
Let us take a careful look at what are the response fields that need to be returned.
- item_id – Unique identifier for the saved item (used in /v3/modify)
- resolved_id – Unique ID for the resolved URL (0 = not processed yet)
- given_url – The actual saved URL
- resolved_url – Final resolved URL (e.g., unshortened link)
- given_title – Title saved with the item
- resolved_title – Title Pocket parsed from the URL
- favorite – 1 if favorited
- status – 0 = active, 1 = archived, 2 = deleted
- excerpt – First few lines of the item (articles only)
- is_article – 1 if item is an article
- has_image – 1 if it has images, 2 if it's an image
- has_video – 1 if it has videos, 2 if it's a video
- word_count – Number of words in the article
- tags – JSON object of user tags
- authors – JSON object of authors
- images – JSON object of images
- videos – JSON object of videos
Firtly we observe that fields 1-13 are available in the articles table. Therefore, fetching them for a user would be trivial. We can just do something like:
SELECT * FROM articles WHERE user_id=user_id