Stream
A stream is a collection of activities created automatically when some events happens in your project. Content creation, like creating an article or commenting a status, triggers an activity creation that will be available inside a stream.
The idea is to easily get a collection of mixed contents with one call.
What's an activity ?
An activity is a reference to an event that happened on your project. It's composed of a owner
who perform an action, verb
that explain the action, a subject
and a target
.
With this 3 data, you can compose a "story' with owner + verb + subject + target (e.g. Page create Status in Page, User like Article in Page)
When it's applicable, you also get a parameter.
Structure
{"id": 0,"verb": 0,"owner_type": "string","owner_id": "string","owner": {"id": 0,"name": 0,"picture_url": "string","banner_url": "string","slug": "string"},"subject_type": "string","subject_id": 0,"subject": {"id": 0,"uid": 0,"name": 0,"picture_url": "string","banner_url": "string","slug": "string"},"target_type": "string","target_id": 0,"target": {"id": 0,"name": 0,"slug": "string"}}
Activity types
- A status is created
- An article is published
- An event is created
- A comment is created
- A like is done
- A follow is done
Stream categories
Public Stream
By default when you ask for a stream, you will get an array of activities that are in public access and viewable by anyone. It's available through an HTTP GET call to /discover
.
User's rights related Stream
As you know, some content is not available to all users.
Some content may be posted under a PageAPI that is flagged with a private or secret privacy. In that case, a user has to follow the page to be granted with the right to see the related content.
Therefore, if you choose to use the Potion users rights management system, some content may not be available to users depending on your rights configuration.
With the user_id
flag on the HTTP GET call, you will get only accessible content to this specific user.
User's follows related Stream
You can also filter the activities you will receive by giving the with_follows
flag in addition to the user_id
parameter. You will only get activities that belongs to elements that's followed by the user or with an interest for him (liked or commented content)
"Belongs to" Stream
One last stream is the stream that belongs to an element. It's usefull to get activities that belongs to that element, like the activities of a page, an event or created by an user.