API documentation for Epic Foundation Inc

/feed

Feed

The feed of Epic news can be found at /feed/

GET: /feed/

GET: /feed/itemId/

Requires scope user

NOTE: the contents of the feed varies according to the user type. Users with scope user will see published, public posts only. Users with role user-donor will see published posts restricted to donors. Users with scole content-manager will see all posts, including unpublished ones.

Parameter Value
itemId STRING OPTIONAL The ID of a feed item. Only that item will be returned if it exists and is accessible by the current user.
itemType STRING OPTIONAL The type of item, which can be photo, link or vlink
lim INT OPTIONAL The maximum number of items returned. Can be absent or greater than 0. Defaults to unlimited.
offset INT OPTIONAL The rank of the first item returned. Will be ignored if lim is not present. Can be absent or greater than or equal to 0. Defaults to 0. NOTE: If you set an offset greater than the size of your result set, nothing will be returned.
lang STRING OPTIONAL The requested language. Should be one of en or fr (case insensitive). Defaults to no language filter.

The response is a collection of items resources (which can be empty):

Example

Example

Make sure your have run the /oauth2/get-token first to have a valid token.

Click on the "Get Feed" button to request the feed:



POST: /feed/

Requires scope user-donor

NOTE: all feed posts have a status of Draft until they are approved by a content-manager. Any associated media (like an image if the type is photo) must be uploaded using /feed/media/


Parameter Value
itemType STRING REQUIRED The type of item, which can be photo, link or vlink
isDonorRestricted STRING OPTIONAL Whether a feed item is restricted to users with a user-donor scope. Value can be 0 or "false" to allow public viewing. Any other value is interpreted as "true".
lang STRING OPTIONAL The language of the item. Should be one of en or fr (case insensitive). Defaults to en
itemTitle STRING REQUIRED The title of the post. Must be up to 100 characters in length.
itemDescription STRING REQUIRED The description of the post (caption of the photo or video, or comment on the external link. Must be up to 1000 characters in length.
vlink URL CONDITIONAL The link to an external video. Only required if the feed item type is vlink
link URL CONDITIONAL The link to an external resource. Only required if the feed item type is link

The created item is returned:

Example

Example

Make sure your have run the /oauth2/get-token first to have a valid token.

Click on the "Get Feed" button to request the feed:




A feed item can be edited via:

POST: /feed/<itemId>

Requires scope content-manager

NOTE: only content-managers and super-admin can edit feeds.

Parameter Value
itemType STRING REQUIRED The type of item, which can be photo, link or vlink
isDonorRestricted STRING OPTIONAL Whether a feed item is restricted to users with a user-donor scope. Value can be 0 or "false" to allow public viewing. Any other value is interpreted as "true".
lang STRING OPTIONAL The language of the item. Should be one of en or fr (case insensitive). Defaults to en
itemTitle STRING REQUIRED The title of the post. Must be up to 100 characters in length.
itemDescription STRING REQUIRED The description of the post (caption of the photo or video, or comment on the external link. Must be up to 1000 characters in length.
vlink URL CONDITIONAL The link to an external video. Only required if the feed item type is vlink
link URL CONDITIONAL The link to an external resource. Required if the feed item type is link. For item type photo, it will be the link to the photo.
status string REQUIRED The status of the item. Can be Live, Draft or Archived. A status of Live can only be set if

The updated item item is returned:

Example

Example

Make sure your have run the /oauth2/get-token first to have a valid token.

Click on the "Get Feed" button to request the feed:



Feed Media

The media associated with a feed item should be uploaded via /feed/media

POST: /feed/<itemId>/media

Requires scope user
Parameter Value
itemId STRING REQUIRED The ID of a feed item. Only that item will be returned if it exists and is accessible by the current user.
itemUploadMedia JPEG or PNG file REQUIRED The image associated with the feed item. If present, must be a jpeg or png photo in 560Hx400W.

The response is a the itemRelatedLink value added to the feed item:

Example

Example

Make sure your have run the /oauth2/get-token first to have a valid token.

Click on the "Post Feed media" button to post the media:



The media associated with a feed item can be removed via /feed/media/

DELETE: /feed/<itemId>/media/

Requires scope content-manager

The response is empty if successful as HTTP_200:

Example

Example

Make sure your have run the /oauth2/get-token first to have a valid token.

Click on the "Delete Library media" button to delete the media:

Feed Label

The labels attributable to a feed can be found at /feed/label

GET: /feed/label

GET: /feed/<itemId>/label

Requires scope user
Parameter Value
itemId STRING CONDITIONAL The ID of a feed item. Equivalent to calling /feed/<itemId>/label with no parameter. If no value is provided (neither as parameter or on the URI), then all available labels are returned.
labelId STRING CONDITIONAL The ID of a label item. Equivalent to calling /feed/label/<labelId> with no parameter. If a value is provided (as parameter or on the URI), then only that label is returned (and if a itemId is mentioned, only if that feed item has that label).

The response is a collection of label :

[ { "label": { "labelId": "education", "en": "education", "fr": "éducation" } }, { "label": { "labelId": "health", "en": "health", "fr": "santé" } } ]

Example

Make sure your have run the /oauth2/get-token first to have a valid token.

Click on the "Get Feed Item label" button to get the labels associated with the feed item:

Labels can be added to a feed item via /feed/label

POST: /feed/<itemId>/label

Requires scope content-manager

NOTE: labels cannot be created via de API at this time. They can only be added to feed items.

Parameter Value
itemId STRING REQUIRED The ID of a feed item.
labelId STRING REQUIRED The ID of a feed label.

The response is a label :

Example

Example

Make sure your have run the /oauth2/get-token first to have a valid token.

Click on the "Post Feed Item label" button to get the labels associated with the feed item:



The label associated with a feed item can be removed via /feed/<item>/label/<labelId>

DELETE: /feed/<itemId>/label/<labelId>

Requires scope content-manager

The response is empty if successful as HTTP_200:

Example

Example

Make sure your have run the /oauth2/get-token first to have a valid token.

Click on the "Delete Feed media label" button to delete the label: