Library
The library of Epic publications can be found at /library/
GET: /library/
GET: /library/itemId/
Requires scope user
NOTE: the contents of the library 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 library item. Only that item will be returned if it exists and is accessible by the current user. |
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 Library" button to request the library:
POST: /library/
Requires scope content-manager
NOTE: all library 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 /library/media/
Parameter | Value |
---|---|
isDonorRestricted | STRING OPTIONAL Whether a library item is restricted to users with a
user 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 | URL 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. |
link | URL REQUIRED The link to the external resource represented by the library item. |
itemPublicationDate | YYYY-MM-DD REQUIRED The publication date associated with the post. |
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 Library" button to request the library:
POST: /library/<itemId>
Requires scope content-manager
NOTE: all library posts have a status of Draft
until they are approved by a content-manager.
Parameter | Value |
---|---|
isDonorRestricted | STRING OPTIONAL Whether a library item is restricted to users with a
user 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 | URL 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. |
link | URL REQUIRED The link to the external resource represented by the library item. |
itemPublicationDate | YYYY-MM-DD CONDITIONAL The publication date associated with the post. Only required if (1) the status of the item is Live or Archived, and (2) it is different from today's date (to which it defaults). |
coverImgUrl | URL CONDITIONAL The URL of the cover image. Must be provided and not empty if the status is Live. |
notificationImgUrl | URL CONDITIONAL The URL of the notification image. Must be provided and not empty if the status is Live. |
status | String REQUIRED The status of the item, which can be
Live, Draft or Archived. NOTE: you cannot publish a library item without a cover image and notification image. |
The response is the updated item
resource :
Example
Example
Make sure your have run the /oauth2/get-token
first to have a valid token.
Click on the "Get Library" button to request the library:
Library Media
The media associated with a library item should be uploaded via /library/media/type
POST: /library/<itemId>/media/(cover|notification)
Requires scope content-manager
The response is empty is successful (as HTTP_200).
Note:
Example
Example
Make sure your have run the /oauth2/get-token
first to have a valid token.
Click on the "Post Library media" button to post the media:
The media associated with a library item can be removed via /library/media/type
DELETE: /library/<itemId>/media/(cover|notification)
Requires scope content-manager
The response is a the itemRelatedLink
value added to the library item:
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:
Library Label
The labels attributable to a library can be found at /library/label
GET: /library/label
GET: /library/<itemId>/label
Requires scope user
Parameter | Value |
---|---|
itemId | STRING CONDITIONAL The ID of a library item. Equivalent to calling /library/<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 /library/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 library 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 Library Item label" button to get the labels associated with the library item:
Labels can be added to a library item via /library/label
POST: /library/<itemId>/label
Requires scope content-manager
NOTE: labels cannot be created via de API at this time. They can only be added to library items.
Parameter | Value |
---|---|
itemId | STRING REQUIRED The ID of a library item. |
labelId | STRING REQUIRED The ID of a library 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 Library Item label" button to get the labels associated with the library item:
The label associated with a library item can be removed via /library/<item>/label/<labelId>
DELETE: /library/<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 Library media label" button to delete the label: