Content¶
Content resources give access to Metro Publisher content types, such as an article, recipe, review or roundup.
/{iid}/content¶
GET¶
Retrieve a batched collection of content objects.
Each item returned by this resource is one of the Metro Publisher content types. Using the ctypes parameter, you can restrict items to specific content types.
Note
The parameters sections and blogs are mutually exclusive, i.e. you can only pass either one of them to this resource but not both at the same time. The parameters can contain one or more UUIDs.
Sample Call¶
>>> GET("/123/content?ctypes=articles-reviews&fields=title-url-issued-thumb_url&order=title&rpp=2")
{'items': [['Article 01',
'https://api.metropublisher.com/123/content/799d6c73-fe75-11df-837b-001ec21bff9e',
'2010-12-02T16:37:00',
'https://api.metropublisher.com/123/files/f6294df8-9023-3687-865b-af22de234abf/download/1291309162'],
['Review 01',
'https://api.metropublisher.com/123/content/a33b5997-00ca-11e0-b096-001ec21bff9e',
'2010-12-05T15:51:00',
'https://api.metropublisher.com/123/files/5a778106-5e32-3af2-9bb6-97aeacf01c8e/download/1291558800']],
'next': 'ctypes=articles-reviews&fields=title-url-issued-thumb_url&order=title&page=2&rpp=2'}
Get only content objects issued before December 4th, 2010:
>>> GET("/123/content?ctypes=articles-reviews&fields=title-url-issued&issued=_2010-12-04&rpp=2")
{'items': [['Article 01',
'https://api.metropublisher.com/123/content/799d6c73-fe75-11df-837b-001ec21bff9e',
'2010-12-02T16:37:00']]}
Get all content objects associated with the blog with the UUID '441d7168-d0c0-11e1-a944-001b63a90f63':
>>> GET("/123/content?fields=title&blogs=441d7168-d0c0-11e1-a944-001b63a90f63")
{'items': [['Blog Entry 01'], ['Blog Entry 02'], ['Blog Entry 03']]}
Get the title of the content object and the UUID for the location associated with the content object, if available/applicable:
>>> GET("/123/content?fields=title-location_uuid&rpp=6&order=title")
{'items': [['Article 01', None],
['Blog Entry 01', None],
['Blog Entry 02', None],
['Blog Entry 03', None],
['Event 01', '22222222-2222-2222-2222-222222222222'],
['Review 01', '11111111-1111-1111-1111-111111111111']],
'next': 'fields=title-location_uuid&order=title&page=2&rpp=6'}
Parameters¶
page: | The page number to retrieve. optional Default: 1 Values must not be lower than 1 |
||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
rpp: | The number of results per page. optional Default: 20 Values must not be lower than 1 or higher than 100 |
||||||||||||||||||||||||||||||||||||||||||||||||
state: | optional Default: 'live' if the user is a public user else None. Example value: "draft" Values must be any of the following
|
||||||||||||||||||||||||||||||||||||||||||||||||
ctypes: | The content types to retrieve (if not specified, return all content types). optional Default: None Every element of the list must be any of the following
|
||||||||||||||||||||||||||||||||||||||||||||||||
fields: | A dash-separated list of fields to return. optional Default: ['url'] Example value: 'blog_uuid-website' Every element of the list must be any of the following
|
||||||||||||||||||||||||||||||||||||||||||||||||
sections: | A underscore-separated list of section UUIDs for which to return content. optional Default: None The parameters sections and blogs are mutually exclusive. |
||||||||||||||||||||||||||||||||||||||||||||||||
blogs: | A underscore-separated list of blog UUIDs for which to return content. Deprecated since MP 2.10: With MP 2.10, sections are enhanced to work like blogs. Old blogs will be available until merged to sections manually via the Metro Pulisher Administration Interface. (also see ChangeLog) optional Default: None Values must obey all the conditions
|
||||||||||||||||||||||||||||||||||||||||||||||||
issued: | A date/time period within which the content was issued. First element is the start of the period, second element is the end of the period. Either start or end can be None. optional Default: None
|
||||||||||||||||||||||||||||||||||||||||||||||||
order: | A dash-separated list of orderings to apply optional Default: [] Example value: 'issued-urlname.desc' Every element of the list must be any of the following
|
/{iid}/content/{uuid}¶
DELETE¶
Deletes a content object.
Sample Call¶
>>> DELETE("/123/content/799d6c73-fe75-11df-837b-001ec21bff9e")
{'msg': 'deleted'}
GET¶
Retrieve one content object.
This resource returns information about one specific content object, e.g. an article or event. What information is returned depends on the role of the API key. Some attributes are not publicly available.
Sample Call¶
>>> GET("/123/content/799d6c73-fe75-11df-837b-001ec21bff9e")
{'blog_uuid': None,
'canonical_url': None,
'content': '<p>Sed elit. In blandit sapien at nisi. ...</p>',
'content_type': 'article',
'created': '2010-12-02T16:37:14.422690',
'description': 'This is descriptive text for an article. ... ',
'evergreen': False,
'feature_image_alttext': None,
'feature_image_caption': None,
'feature_image_url': 'https://api.metropublisher.com/123/files/f6294df8-9023-3687-865b-af22de234abf',
'feature_thumb_url': 'https://api.metropublisher.com/123/files/f6294df8-9023-3687-865b-af22de234abf',
'header_image_url': None,
'issued': '2010-12-02T16:37:00',
'meta_description': None,
'meta_title': None,
'modified': '2010-12-02T16:37:14.422690',
'perma_url_path': None,
'print_description': None,
'section_uuid': 'c1c1b3dc-d24a-11e1-b1d7-001b63a90f63',
'state': 'published',
'sub_title': None,
'teaser_image_url': 'https://api.metropublisher.com/123/files/f6294df8-9023-3687-865b-af22de234abf',
'title': 'Article 01',
'urlname': 'article-01',
'uuid': '799d6c73-fe75-11df-837b-001ec21bff9e',
'video_uuid': None}
Return Value¶
Additional return values for type: article
blog_uuid: | The UUID of the blog the content object is associated with (None if content object is not part of a blog). |
---|---|
evergreen: | The content is an evergreen, i.e. it was not created due to current events and can be read at any time, independent of its issue date. |
section_uuid: | The UUID of the section the content object is associated with (None if content object resides outside any section). |
Additional return values for type: event
allday: | |
---|---|
canonical: | Access is restricted to users with these roles: |
dtend: | The end date/time of either the event or its first occurrence. See also RFC 5545. |
dtstart: | The start date/time of either the event or its first occurrence. See also RFC 5545. |
email: | Email to contact the event organizer. |
event_source: | Access is restricted to users with these roles: |
event_status_type: | The status of the event, such as 'cancelled'. |
exdates: | If the event is a recurring event, this is a list of all the exceptions to the recurrence rule. See also RFC 5545. |
ical_uid: | The event's unique identifier, see RFC 5545. Access is restricted to users with these roles: |
location_alt: | An alternative for location_uuid. It can be used if the location is not a reusable location and was therefore not created in the Metro Publisher instance. This may be the case, for example, if it is not a real location and does not have usable location data such as an address or geolocation. Access is restricted to users with these roles: |
location_uuid: | The location UUID associated with this content object. |
phone: | A phone number to contact the event organizer. |
prices: | Price information for the event. |
rdates: | If the event is a recurring event, this is a list of all additional occurrences for the event. See also RFC 5545. |
recurrence_id: | The recurrence_id for this event, see RFC 5545. Access is restricted to users with these roles: |
rrule: | a dictionary with the recurrence rule settings or None |
sort_title: | |
sponsored: | The event is sponsored. Only available with Directory Add-on. Note only available for instances with Directory Add-On |
time_type: | Access is restricted to users with these roles: |
user_email: | Email of the user who submitted the event. |
website: | The url to an external event website. |
canonical_url: | Returns None if the MP-internal URL is the canonical URL of the content. |
---|---|
content: | see Content-XML |
content_type: | see Content Types |
created: | The creation date/time in ISO 8601 format. See Dates and Times. Access is restricted to users with these roles: |
description: | A short description of the content. |
header_image_url: | URL of the wide feature image. |
issued: | The date/time the content object was issued (see issued and Dates and Times). |
meta_description: | The text for the HTML meta description tag on the content page. |
meta_title: | The text for the HTML meta title tag on the content page. |
modified: | The date/time of last modification in ISO 8601 format. See Dates and Times. Access is restricted to users with these roles: |
perma_url_path: | The permanent path to the content object (see Consideration When Migrating Content). Note Should only be used if the content is imported from another system and has already acquired significant social media / search engine recognition. |
print_description: | |
state: | The state of the content object, i.e. 'draft' or 'published'. Access is restricted to users with these roles: |
sub_title: | The content sub title |
teaser_image_url: | URL of the teaser image. |
title: | The content title |
urlname: | see urlname |
uuid: |
Additional return values for type: recipe
evergreen: | The content is an evergreen, i.e. it was not created due to current events and can be read at any time, independent of its issue date. |
---|---|
recipe_cook_time: | The cooking time in minutes. |
recipe_image_url: | |
recipe_ingredients: | A list of dictionaries with the recipe ingredients. |
recipe_prep_time: | The preparation time in minutes. |
recipe_yield: | The recipe yield, e.g. '1 loaf'. |
Additional return values for type: review_album
album_buy_link_text: | |
---|---|
album_buy_url: | |
album_buy_urls: | A list of dictionaries with the URL (and link text) to external websites to buy the album. New in MP 3.x: Object Reviews (album, book, product) can now have multiple non-provider buy urls. (also see ChangeLog) |
album_image_url: | |
album_issued: | The date when the album was / is going to be published. This can be some general text, such as 'October 2014', or a date as a string, such as '2014-06-05'. |
album_provider_urls: | A list of Amazon or iTunes urls. |
album_title: | The title of the album that is being reviewed. |
evergreen: | The content is an evergreen, i.e. it was not created due to current events and can be read at any time, independent of its issue date. |
rating: | The rating for the object that is being reviewed. |
Additional return values for type: review_book
book_buy_link_text: | |
---|---|
book_buy_url: | |
book_buy_urls: | A list of dictionaries with the URL (and link text) to external websites to buy the book. New in MP 3.x: Object Reviews (album, book, product) can now have multiple non-provider buy urls. (also see ChangeLog) |
book_image_url: | |
book_isbn: | The ISBN of the book that is being reviewed.This must be a valid ISBN-10 or ISBN-13. |
book_issued: | The date when the book was / is going to be published. This can be some general text, such as 'October 2014', or a date as a string, such as '2014-06-05'. |
book_provider_urls: | A list of Amazon or iTunes urls. |
book_title: | The title of the book that is being reviewed. |
evergreen: | The content is an evergreen, i.e. it was not created due to current events and can be read at any time, independent of its issue date. |
rating: | The rating for the object that is being reviewed. |
Additional return values for type: review_location
blog_uuid: | The UUID of the blog the content object is associated with (None if content object is not part of a blog). |
---|---|
evergreen: | The content is an evergreen, i.e. it was not created due to current events and can be read at any time, independent of its issue date. |
location_uuid: | The location UUID associated with this content object. |
rating: | The rating for the object that is being reviewed. |
section_uuid: | The UUID of the section the content object is associated with (None if content object resides outside any section). |
Additional return values for type: review_movie
evergreen: | The content is an evergreen, i.e. it was not created due to current events and can be read at any time, independent of its issue date. |
---|---|
movie_buy_urls: | A list of dictionaries with the URL (and link text) to external websites to buy the movie. |
movie_duration: | The movie duration, in minutes. |
movie_image_url: | |
movie_issued: | The date when the movie was / is going to be published. This can be some general text, such as 'October 2014', or a date as a string, such as '2014-06-05'. |
movie_provider_urls: | A list of Amazon or iTunes urls. |
movie_title: | The title of the movie that is being reviewed. |
rating: | The rating for the object that is being reviewed. |
Additional return values for type: review_product
evergreen: | The content is an evergreen, i.e. it was not created due to current events and can be read at any time, independent of its issue date. |
---|---|
product_buy_link_text: | |
product_buy_url: | |
product_buy_urls: | A list of dictionaries with the URL (and link text) to external websites to buy the product. New in MP 3.x: Object Reviews (album, book, product) can now have multiple non-provider buy urls. (also see ChangeLog) |
product_image_url: | |
product_issued: | The date when the product was / is going to be released. This can be some general text, such as 'October 2014', or a date as a string, such as '2014-06-05'. |
product_provider_urls: | A list of Amazon or iTunes urls. |
product_title: | The title of the product that is being reviewed. |
rating: | The rating for the object that is being reviewed. |
Additional return values for type: roundup_content
evergreen: | The content is an evergreen, i.e. it was not created due to current events and can be read at any time, independent of its issue date. |
---|---|
roundup_content_targets: | A list of dictionaries, each defining the content UUID. |
roundup_numbering: | The sorting of the list. |
Additional return values for type: roundup_location
evergreen: | The content is an evergreen, i.e. it was not created due to current events and can be read at any time, independent of its issue date. |
---|---|
roundup_location_hide_map: | |
roundup_location_tour_type: | Default type for the Google Directions Service |
roundup_locations: | A list of dictionaries, each defining the location UUID, override description and override image. |
roundup_numbering: | The sorting of the list. |
PUT¶
Create/update a content object.
Sending data to this resource does one of two things:
(see content types)
Sample Call¶
>>> PUT("/123/content/12345678-1234-1234-1234-123456789abc",
... {"urlname": "article-a",
... "content_type": "article",
... "title": "Article A",
... "state": "draft",
... "content": "<p>This is the content of the article.</p>",
... "teaser_image_uuid": "186fa89b-1ecf-3e94-a144-0603362ed675",
... })
{'url': 'https://api.metropublisher.com/123/content/12345678-1234-1234-1234-123456789abc',
'uuid': '12345678-1234-1234-1234-123456789abc'}
Parameters¶
urlname: | see urlname required Example value: "om-østerbro" Values must obey all the conditions
|
||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
content_type: | see content types, also please note that there are additional parameters depending on the content type specified here required Example value: "article" Values must be any of the following
|
||||||||||||||||||||||||
perma_url_path: | The permanent path to the content object (see Consideration When Migrating Content). Note Should only be used if the content is imported from another system and has already acquired significant social media / search engine recognition. optional Default: None must be unique and start with a slash ('/') |
||||||||||||||||||||||||
canonical_url: | Only set a value with this parameter if the canonical URL is different than the MP-internal url of the content, i.e. a URL to differnt website. optional Example value: "http://www.test.com/canonical/url/article.html" Values must obey all the conditions
|
||||||||||||||||||||||||
title: | The content title required Example value: "Om Østerbro" Value must not contain unicode characters x00-x08 or x0b-x1f |
||||||||||||||||||||||||
sub_title: | The content sub title optional Default: None Example value: "Alt om Østerbro" |
||||||||||||||||||||||||
description: | A short description of the content. optional Default: None Values must not be longer than 250 |
||||||||||||||||||||||||
content: | see Content-XML optional Default: None Example value: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.<p>" Values must obey all the conditions
|
||||||||||||||||||||||||
created: | The creation date/time in ISO 8601 format. See Dates and Times. optional Default: <current timestamp> Example value: '2012-01-01T11:30:45' Values must restricted to users with these roles: |
||||||||||||||||||||||||
modified: | The date/time of last modification in ISO 8601 format. See Dates and Times. optional Default: <current timestamp> Example value: '2012-01-01T11:30:45' Values must restricted to users with these roles: |
||||||||||||||||||||||||
issued: | The date/time the content object was issued (see issued and Dates and Times). optional Note required if the parameter state is set to 'published'. Example value: '2012-01-01T11:30:45' Values must restricted to users with these roles: |
||||||||||||||||||||||||
state: | optional Default: 'draft' Values must be any of the following
|
||||||||||||||||||||||||
meta_title: | The text for the HTML meta title tag. optional Default: None Example value: "Om Østerbro" |
||||||||||||||||||||||||
meta_description: | The text for the HTML meta description tag. optional Default: None Example value: "En artikel om Østerbro i København." |
||||||||||||||||||||||||
teaser_image_uuid: | The UUID of the teaser image. optional Default: None Example value: '123456578-1234-1234-1234-123456789abc' Values must obey all the conditions
|
||||||||||||||||||||||||
header_image_uuid: | The UUID of the wide feature image. optional Default: None Example value: '123456578-1234-1234-1234-123456789abc' Values must obey all the conditions
|
||||||||||||||||||||||||
print_description: | optional Default: None |
Additional parameters for type: article
evergreen: | The content is an evergreen, i.e. it was not created due to current events and can be read at any time, independent of its issue date. optional Default: False |
---|---|
section_uuid: | The UUID of the section the content object is associated with (None if content object resides outside any section). optional Example value: '12345678-1234-1234-1234-123456789abc' Section with the given UUID must exist in the Metro Publisher instance. |
blog_uuid: | The UUID of the blog the content object is associated with (None if content object is not part of a blog). optional Example value: '12345678-1234-1234-1234-123456789abc' Values must obey all the conditions
|
Additional parameters for type: event
location_uuid: | The location UUID associated with this content object. optional Example value: '12345678-1234-1234-1234-123456789abc' Location with the given UUID must exist in the Metro Publisher instance. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
location_alt: | An alternative for location_uuid. It can be used if the location is not a reusable location and should therefore not be created in the Metro Publisher instance. This may be the case, for example, if it is not a real location and does not have usable location data such as an address or geolocation. optional Example value: "Conference Room 18, Convention Center" Required if no 'location_uuid' is given, but must be None if 'location_uuid' is given. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
dtstart: | The start date/time of either the event or its first occurrence. See also RFC 5545. required Example value: '2012-01-01T11:30:45' Event start date/time must be before end date/time. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
dtend: | The end date/time of either the event or its first occurrence. See also RFC 5545. required Example value: '2012-01-01T11:30:45' |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
website: | The url to an external event website. optional Example value: "http://www.ourevent2012.com" Values must obey all the conditions
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
prices: | Price information for the event. optional Default: None |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
user_email: | Email of the user who submitted the event. optional Default: None Values must match the following regular expression: ^[A-Za-z0-9!#$%&'*+/=?^_`{|}~.-]+@[A-Za-z0-9.-]+\.[A-Za-z]*$
Info: The regular expression tries to verify the following pattern: <string of characters>@<string of characters>.<string of characters> The first string may contain a number of different special characters besides letters and numbers, such as an underscore (_) or asterisk (*), while the second string must contain only letters, numbers, dashes (-) and dots (.). |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
email: | Email to contact the event organizer. optional Default: None Values must match the following regular expression: ^[A-Za-z0-9!#$%&'*+/=?^_`{|}~.-]+@[A-Za-z0-9.-]+\.[A-Za-z]*$
Info: The regular expression tries to verify the following pattern: <string of characters>@<string of characters>.<string of characters> The first string may contain a number of different special characters besides letters and numbers, such as an underscore (_) or asterisk (*), while the second string must contain only letters, numbers, dashes (-) and dots (.). |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
sponsored: | The event is sponsored. Only available with Directory Add-on. optional Default: False Values must obey all the conditions
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
event_status_type: | The status of the event, such as 'cancelled'. optional Default: None Must be one of 'cancelled', 'postponed', 'rescheduled', 'moved_online' |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
phone: | A phone number to contact the event organizer. optional |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
rrule: | The recurrence rule definitions for the event. See RFC 5545. optional Default: None
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
rdates: | A list of either date objects or datetime objects that specify any additional occurrences outside the rule defining a recurring event. See RFC 5545. optional Default: [] |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
exdates: | A list of either date objects or datetime objects that specify any exceptions to occurrences defined by the recurrence rule of a recurring event. See RFC 5545. optional Default: [] |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
recurrence_id: | The recurrence_id for this event, see RFC 5545. optional |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ical_uid: | The event's unique identifier, see RFC 5545. required |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
sort_title: | optional |
Additional parameters for type: recipe
evergreen: | The content is an evergreen, i.e. it was not created due to current events and can be read at any time, independent of its issue date. optional Default: False |
||||||
---|---|---|---|---|---|---|---|
section_uuid: | The UUID of the section the content object is associated with (None if content object resides outside any section). optional Example value: '12345678-1234-1234-1234-123456789abc' Section with the given UUID must exist in the Metro Publisher instance. |
||||||
recipe_prep_time: | The preparation time in minutes. optional Default: None |
||||||
recipe_cook_time: | The cooking time in minutes. optional Default: None |
||||||
recipe_yield: | The recipe yield, e.g. '1 loaf'. optional Default: None Values must not be longer than 150 |
||||||
recipe_ingredients: | A list of dictionaries with the recipe ingredients. optional Default: None Example value: [{'ingredient': 'self-rising flour', 'unit': 'g', 'amount': 250}] Every element of the list is a dictionary, each consisting of the following fields:
|
||||||
recipe_image_uuid: | The UUID of the recipe image. optional Default: None Example value: '123456578-1234-1234-1234-123456789abc' Values must obey all the conditions
|
Additional parameters for type: review_album
evergreen: | The content is an evergreen, i.e. it was not created due to current events and can be read at any time, independent of its issue date. optional Default: False |
||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
section_uuid: | The UUID of the section the content object is associated with (None if content object resides outside any section). optional Example value: '12345678-1234-1234-1234-123456789abc' Section with the given UUID must exist in the Metro Publisher instance. |
||||||||||||||||||||||
blog_uuid: | The UUID of the blog the content object is associated with (None if content object is not part of a blog). optional Example value: '12345678-1234-1234-1234-123456789abc' Values must obey all the conditions
|
||||||||||||||||||||||
rating: | The rating for the object that is being reviewed. optional Values must be any of the following
|
||||||||||||||||||||||
album_title: | The title of the album that is being reviewed. required |
||||||||||||||||||||||
album_image_uuid: | The UUID of the album cover. optional Default: None Example value: '123456578-1234-1234-1234-123456789abc' Values must obey all the conditions
|
||||||||||||||||||||||
album_issued: | The date when the album was / is going to be published. This can be some general text, such as 'October 2014', or a date as a string, such as '2014-06-05'. optional Default: None |
||||||||||||||||||||||
album_provider_urls: | A list of Amazon or iTunes urls. optional Default: None Example value: ['http://www.amazon.fr/gp/product/B00I9NJG96/', 'http://itunes.apple.com/app/id426698291&mt=8'] Every element of the list must obey all the conditions
|
||||||||||||||||||||||
album_buy_urls: | A list of dictionaries with url / link text to websites where the album can be bought. New in MP 3.x: Object Reviews (album, book, product) can now have multiple non-provider buy urls. (also see ChangeLog) optional Default: None Example value: [{'link_text': 'Buy at SomePlace', 'url': 'http://www.someplace.com/product/12345.html'}] The parameters album_buy_urls and album_buy_url/album_buy_link_text are mutually exclusive. Every element of the list is a dictionary, each consisting of the following fields:
|
||||||||||||||||||||||
album_buy_url: |
optional Default: None Values must obey all the conditions
|
||||||||||||||||||||||
album_buy_link_text: |
optional Default: None Values must not be longer than 50 |
Additional parameters for type: review_book
evergreen: | The content is an evergreen, i.e. it was not created due to current events and can be read at any time, independent of its issue date. optional Default: False |
||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
section_uuid: | The UUID of the section the content object is associated with (None if content object resides outside any section). optional Example value: '12345678-1234-1234-1234-123456789abc' Section with the given UUID must exist in the Metro Publisher instance. |
||||||||||||||||||||||
blog_uuid: | The UUID of the blog the content object is associated with (None if content object is not part of a blog). optional Example value: '12345678-1234-1234-1234-123456789abc' Values must obey all the conditions
|
||||||||||||||||||||||
rating: | The rating for the object that is being reviewed. optional Values must be any of the following
|
||||||||||||||||||||||
book_title: | The title of the book that is being reviewed. required |
||||||||||||||||||||||
book_image_uuid: | The UUID of the book cover. optional Default: None Example value: '123456578-1234-1234-1234-123456789abc' Values must obey all the conditions
|
||||||||||||||||||||||
book_isbn: | The ISBN of the book that is being reviewed.This must be a valid ISBN-10 or ISBN-13. required must be an ISBN-10 or ISBN-13 |
||||||||||||||||||||||
book_issued: | The date when the book was / is going to be published. This can be some general text, such as 'October 2014', or a date as a string, such as '2014-06-05'. optional Default: None |
||||||||||||||||||||||
book_provider_urls: | A list of Amazon or iTunes urls. optional Default: None Example value: ['http://www.amazon.fr/gp/product/B00I9NJG96/', 'http://itunes.apple.com/app/id426698291&mt=8'] Every element of the list must obey all the conditions
|
||||||||||||||||||||||
book_buy_urls: | A list of dictionaries with url / link text to websites where the book can be bought. New in MP 3.x: Object Reviews (album, book, product) can now have multiple non-provider buy urls. (also see ChangeLog) optional Default: None Example value: [{'link_text': 'Buy at SomePlace', 'url': 'http://www.someplace.com/product/12345.html'}] The parameters book_buy_urls and book_buy_url/book_buy_link_text are mutually exclusive. Every element of the list is a dictionary, each consisting of the following fields:
|
||||||||||||||||||||||
book_buy_url: |
optional Default: None Values must obey all the conditions
|
||||||||||||||||||||||
book_buy_link_text: |
optional Default: None Values must not be longer than 50 |
Additional parameters for type: review_location
evergreen: | The content is an evergreen, i.e. it was not created due to current events and can be read at any time, independent of its issue date. optional Default: False |
||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
section_uuid: | The UUID of the section the content object is associated with (None if content object resides outside any section). optional Example value: '12345678-1234-1234-1234-123456789abc' Section with the given UUID must exist in the Metro Publisher instance. |
||||||||||||||||||||||
location_uuid: | The location UUID associated with this content object. optional Example value: '12345678-1234-1234-1234-123456789abc' Location with the given UUID must exist in the Metro Publisher instance. |
||||||||||||||||||||||
blog_uuid: | The UUID of the blog the content object is associated with (None if content object is not part of a blog). optional Example value: '12345678-1234-1234-1234-123456789abc' Values must obey all the conditions
|
||||||||||||||||||||||
rating: | The rating for the object that is being reviewed. optional Values must be any of the following
|
Additional parameters for type: review_movie
evergreen: | The content is an evergreen, i.e. it was not created due to current events and can be read at any time, independent of its issue date. optional Default: False |
||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
section_uuid: | The UUID of the section the content object is associated with (None if content object resides outside any section). optional Example value: '12345678-1234-1234-1234-123456789abc' Section with the given UUID must exist in the Metro Publisher instance. |
||||||||||||||||||||||
rating: | The rating for the object that is being reviewed. optional Values must be any of the following
|
||||||||||||||||||||||
movie_title: | The title of the movie that is being reviewed. required |
||||||||||||||||||||||
movie_image_uuid: | The UUID of the movie cover. optional Default: None Example value: '123456578-1234-1234-1234-123456789abc' Values must obey all the conditions
|
||||||||||||||||||||||
movie_issued: | The date when the movie was / is going to be published. This can be some general text, such as 'October 2014', or a date as a string, such as '2014-06-05'. optional Default: None |
||||||||||||||||||||||
movie_provider_urls: | A list of Amazon or iTunes urls. optional Default: None Example value: ['http://www.amazon.fr/gp/product/B00I9NJG96/', 'http://itunes.apple.com/app/id426698291&mt=8'] Every element of the list must obey all the conditions
|
||||||||||||||||||||||
movie_buy_urls: | A list of dictionaries with url / link text to websites where the movie can be bought. New in MP 3.x: Object Reviews (album, book, product) can now have multiple non-provider buy urls. (also see ChangeLog) optional Default: None Example value: [{'link_text': 'Buy at SomePlace', 'url': 'http://www.someplace.com/product/12345.html'}] Every element of the list is a dictionary, each consisting of the following fields:
|
||||||||||||||||||||||
movie_duration: | The movie duration, in minutes. optional Default: None |
Additional parameters for type: review_product
evergreen: | The content is an evergreen, i.e. it was not created due to current events and can be read at any time, independent of its issue date. optional Default: False |
||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
section_uuid: | The UUID of the section the content object is associated with (None if content object resides outside any section). optional Example value: '12345678-1234-1234-1234-123456789abc' Section with the given UUID must exist in the Metro Publisher instance. |
||||||||||||||||||||||
blog_uuid: | The UUID of the blog the content object is associated with (None if content object is not part of a blog). optional Example value: '12345678-1234-1234-1234-123456789abc' Values must obey all the conditions
|
||||||||||||||||||||||
rating: | The rating for the object that is being reviewed. optional Values must be any of the following
|
||||||||||||||||||||||
product_title: | The title of the product that is being reviewed. required |
||||||||||||||||||||||
product_image_uuid: | The UUID of the product image. optional Default: None Example value: '123456578-1234-1234-1234-123456789abc' Values must obey all the conditions
|
||||||||||||||||||||||
product_issued: | The date when the product was / is going to be released. This can be some general text, such as 'October 2014', or a date as a string, such as '2014-06-05'. optional Default: None |
||||||||||||||||||||||
product_provider_urls: | A list of Amazon or iTunes urls. optional Default: None Example value: ['http://www.amazon.fr/gp/product/B00I9NJG96/', 'http://itunes.apple.com/app/id426698291&mt=8'] Every element of the list must obey all the conditions
|
||||||||||||||||||||||
product_buy_urls: | A list of dictionaries with url / link text to websites where the product can be bought. New in MP 3.x: Object Reviews (album, book, product) can now have multiple non-provider buy urls. (also see ChangeLog) optional Default: None Example value: [{'link_text': 'Buy at SomePlace', 'url': 'http://www.someplace.com/product/12345.html'}] The parameters product_buy_urls and product_buy_url/product_buy_link_text are mutually exclusive. Every element of the list is a dictionary, each consisting of the following fields:
|
||||||||||||||||||||||
product_buy_url: |
optional Default: None Values must obey all the conditions
|
||||||||||||||||||||||
product_buy_link_text: |
optional Default: None Values must not be longer than 50 |
Additional parameters for type: roundup_content
evergreen: | The content is an evergreen, i.e. it was not created due to current events and can be read at any time, independent of its issue date. optional Default: False |
||||||
---|---|---|---|---|---|---|---|
roundup_location_tour_type: | Default type for the Google Directions Service optional Default: None Values must be any of the following
|
||||||
roundup_content_targets: | The list of content targets for this roundup. required Every element of the list is a dictionary, each consisting of the following fields:
|
||||||
roundup_numbering: | The sorting of the list. optional Default: 'ascending' Values must be any of the following
|
Additional parameters for type: roundup_location
evergreen: | The content is an evergreen, i.e. it was not created due to current events and can be read at any time, independent of its issue date. optional Default: False |
||||||||
---|---|---|---|---|---|---|---|---|---|
roundup_locations: | The list of locations for this roundup. required Every element of the list is a dictionary, each consisting of the following fields:
|
||||||||
roundup_location_tour_type: | Default type for the Google Directions Service optional Default: None Values must be any of the following
|
||||||||
roundup_location_hide_map: | optional Default: False |
||||||||
roundup_numbering: | The sorting of the list. optional Default: 'ascending' Values must be any of the following
|
/{iid}/content/{uuid}¶
PATCH¶
Update specific attributes of a content object.
Note
You cannot change the content type via PATCH. Use PUT /{iid}/content/{uuid}.
Sample Call¶
>>> PATCH("/123/content/799d6c73-fe75-11df-837b-001ec21bff9e",
... {'title': 'NEW TITLE'})
{'url': 'https://api.metropublisher.com/123/content/799d6c73-fe75-11df-837b-001ec21bff9e',
'uuid': '799d6c73-fe75-11df-837b-001ec21bff9e'}
Parameters¶
urlname: | see urlname optional Example value: "om-østerbro" Values must obey all the conditions
|
||||
---|---|---|---|---|---|
perma_url_path: | The permanent path to the content object (see Consideration When Migrating Content). Note Should only be used if the content is imported from another system and has already acquired significant social media / search engine recognition. optional must be unique and start with a slash ('/') |
||||
canonical_url: | Only set a value with this parameter if the canonical URL is different than the MP-internal url of the content, i.e. a URL to differnt website. optional Example value: "http://www.test.com/canonical/url/article.html" Values must obey all the conditions
|
||||
title: | The content title optional Example value: "Om Østerbro" Value must not contain unicode characters x00-x08 or x0b-x1f |
||||
sub_title: | The content sub title optional Example value: "Alt om Østerbro" |
||||
description: | A short description of the content. optional Values must not be longer than 250 |
||||
content: | see Content-XML optional Example value: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.<p>" Values must obey all the conditions
|
||||
created: | The creation date/time in ISO 8601 format. See Dates and Times. optional Example value: '2012-01-01T11:30:45' Values must restricted to users with these roles: |
||||
modified: | The date/time of last modification in ISO 8601 format. See Dates and Times. optional Example value: '2012-01-01T11:30:45' Values must restricted to users with these roles: |
||||
issued: | The date/time the content object was issued (see issued and Dates and Times). optional Note required if the parameter state is set to 'published'. Example value: '2012-01-01T11:30:45' Values must restricted to users with these roles: |
||||
state: | optional Values must be any of the following
|
||||
meta_title: | The text for the HTML meta title tag. optional Example value: "Om Østerbro" |
||||
meta_description: | The text for the HTML meta description tag. optional Example value: "En artikel om Østerbro i København." |
||||
teaser_image_uuid: | The UUID of the teaser image. optional Example value: '123456578-1234-1234-1234-123456789abc' Values must obey all the conditions
|
||||
header_image_uuid: | The UUID of the wide feature image. optional Example value: '123456578-1234-1234-1234-123456789abc' Values must obey all the conditions
|
||||
print_description: | optional |
Additional parameters for type: article
evergreen: | The content is an evergreen, i.e. it was not created due to current events and can be read at any time, independent of its issue date. optional |
---|---|
section_uuid: | The UUID of the section the content object is associated with (None if content object resides outside any section). optional Example value: '12345678-1234-1234-1234-123456789abc' Section with the given UUID must exist in the Metro Publisher instance. |
blog_uuid: | The UUID of the blog the content object is associated with (None if content object is not part of a blog). optional Example value: '12345678-1234-1234-1234-123456789abc' Values must obey all the conditions
|
Additional parameters for type: event
location_uuid: | The location UUID associated with this content object. optional Example value: '12345678-1234-1234-1234-123456789abc' Location with the given UUID must exist in the Metro Publisher instance. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
location_alt: | An alternative for location_uuid. It can be used if the location is not a reusable location and should therefore not be created in the Metro Publisher instance. This may be the case, for example, if it is not a real location and does not have usable location data such as an address or geolocation. optional Example value: "Conference Room 18, Convention Center" Required if no 'location_uuid' is given, but must be None if 'location_uuid' is given. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
dtstart: | The start date/time of either the event or its first occurrence. See also RFC 5545. optional Example value: '2012-01-01T11:30:45' Event start date/time must be before end date/time. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
dtend: | The end date/time of either the event or its first occurrence. See also RFC 5545. optional Example value: '2012-01-01T11:30:45' |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
website: | The url to an external event website. optional Example value: "http://www.ourevent2012.com" Values must obey all the conditions
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
prices: | Price information for the event. optional |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
user_email: | Email of the user who submitted the event. optional Values must match the following regular expression: ^[A-Za-z0-9!#$%&'*+/=?^_`{|}~.-]+@[A-Za-z0-9.-]+\.[A-Za-z]*$
Info: The regular expression tries to verify the following pattern: <string of characters>@<string of characters>.<string of characters> The first string may contain a number of different special characters besides letters and numbers, such as an underscore (_) or asterisk (*), while the second string must contain only letters, numbers, dashes (-) and dots (.). |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
email: | Email to contact the event organizer. optional Values must match the following regular expression: ^[A-Za-z0-9!#$%&'*+/=?^_`{|}~.-]+@[A-Za-z0-9.-]+\.[A-Za-z]*$
Info: The regular expression tries to verify the following pattern: <string of characters>@<string of characters>.<string of characters> The first string may contain a number of different special characters besides letters and numbers, such as an underscore (_) or asterisk (*), while the second string must contain only letters, numbers, dashes (-) and dots (.). |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
sponsored: | The event is sponsored. Only available with Directory Add-on. optional Values must obey all the conditions
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
event_status_type: | The status of the event, such as 'cancelled'. optional Must be one of 'cancelled', 'postponed', 'rescheduled', 'moved_online' |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
phone: | A phone number to contact the event organizer. optional |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
rrule: | The recurrence rule definitions for the event. See RFC 5545. optional
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
rdates: | A list of either date objects or datetime objects that specify any additional occurrences outside the rule defining a recurring event. See RFC 5545. optional |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
exdates: | A list of either date objects or datetime objects that specify any exceptions to occurrences defined by the recurrence rule of a recurring event. See RFC 5545. optional |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
recurrence_id: | The recurrence_id for this event, see RFC 5545. optional |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ical_uid: | The event's unique identifier, see RFC 5545. optional |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
sort_title: | optional |
Additional parameters for type: recipe
evergreen: | The content is an evergreen, i.e. it was not created due to current events and can be read at any time, independent of its issue date. optional |
||||||
---|---|---|---|---|---|---|---|
section_uuid: | The UUID of the section the content object is associated with (None if content object resides outside any section). optional Example value: '12345678-1234-1234-1234-123456789abc' Section with the given UUID must exist in the Metro Publisher instance. |
||||||
recipe_prep_time: | The preparation time in minutes. optional |
||||||
recipe_cook_time: | The cooking time in minutes. optional |
||||||
recipe_yield: | The recipe yield, e.g. '1 loaf'. optional Values must not be longer than 150 |
||||||
recipe_ingredients: | A list of dictionaries with the recipe ingredients. optional Example value: [{'ingredient': 'self-rising flour', 'unit': 'g', 'amount': 250}] Every element of the list is a dictionary, each consisting of the following fields:
|
||||||
recipe_image_uuid: | The UUID of the recipe image. optional Example value: '123456578-1234-1234-1234-123456789abc' Values must obey all the conditions
|
Additional parameters for type: review_album
evergreen: | The content is an evergreen, i.e. it was not created due to current events and can be read at any time, independent of its issue date. optional |
||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
section_uuid: | The UUID of the section the content object is associated with (None if content object resides outside any section). optional Example value: '12345678-1234-1234-1234-123456789abc' Section with the given UUID must exist in the Metro Publisher instance. |
||||||||||||||||||||||
blog_uuid: | The UUID of the blog the content object is associated with (None if content object is not part of a blog). optional Example value: '12345678-1234-1234-1234-123456789abc' Values must obey all the conditions
|
||||||||||||||||||||||
rating: | The rating for the object that is being reviewed. optional Values must be any of the following
|
||||||||||||||||||||||
album_title: | The title of the album that is being reviewed. optional |
||||||||||||||||||||||
album_image_uuid: | The UUID of the album cover. optional Example value: '123456578-1234-1234-1234-123456789abc' Values must obey all the conditions
|
||||||||||||||||||||||
album_issued: | The date when the album was / is going to be published. This can be some general text, such as 'October 2014', or a date as a string, such as '2014-06-05'. optional |
||||||||||||||||||||||
album_provider_urls: | A list of Amazon or iTunes urls. optional Example value: ['http://www.amazon.fr/gp/product/B00I9NJG96/', 'http://itunes.apple.com/app/id426698291&mt=8'] Every element of the list must obey all the conditions
|
||||||||||||||||||||||
album_buy_urls: | A list of dictionaries with url / link text to websites where the album can be bought. New in MP 3.x: Object Reviews (album, book, product) can now have multiple non-provider buy urls. (also see ChangeLog) optional Example value: [{'link_text': 'Buy at SomePlace', 'url': 'http://www.someplace.com/product/12345.html'}] The parameters album_buy_urls and album_buy_url/album_buy_link_text are mutually exclusive. Every element of the list is a dictionary, each consisting of the following fields:
|
||||||||||||||||||||||
album_buy_url: |
optional Values must obey all the conditions
|
||||||||||||||||||||||
album_buy_link_text: |
optional Values must not be longer than 50 |
Additional parameters for type: review_book
evergreen: | The content is an evergreen, i.e. it was not created due to current events and can be read at any time, independent of its issue date. optional |
||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
section_uuid: | The UUID of the section the content object is associated with (None if content object resides outside any section). optional Example value: '12345678-1234-1234-1234-123456789abc' Section with the given UUID must exist in the Metro Publisher instance. |
||||||||||||||||||||||
blog_uuid: | The UUID of the blog the content object is associated with (None if content object is not part of a blog). optional Example value: '12345678-1234-1234-1234-123456789abc' Values must obey all the conditions
|
||||||||||||||||||||||
rating: | The rating for the object that is being reviewed. optional Values must be any of the following
|
||||||||||||||||||||||
book_title: | The title of the book that is being reviewed. optional |
||||||||||||||||||||||
book_image_uuid: | The UUID of the book cover. optional Example value: '123456578-1234-1234-1234-123456789abc' Values must obey all the conditions
|
||||||||||||||||||||||
book_isbn: | The ISBN of the book that is being reviewed.This must be a valid ISBN-10 or ISBN-13. optional must be an ISBN-10 or ISBN-13 |
||||||||||||||||||||||
book_issued: | The date when the book was / is going to be published. This can be some general text, such as 'October 2014', or a date as a string, such as '2014-06-05'. optional |
||||||||||||||||||||||
book_provider_urls: | A list of Amazon or iTunes urls. optional Example value: ['http://www.amazon.fr/gp/product/B00I9NJG96/', 'http://itunes.apple.com/app/id426698291&mt=8'] Every element of the list must obey all the conditions
|
||||||||||||||||||||||
book_buy_urls: | A list of dictionaries with url / link text to websites where the book can be bought. New in MP 3.x: Object Reviews (album, book, product) can now have multiple non-provider buy urls. (also see ChangeLog) optional Example value: [{'link_text': 'Buy at SomePlace', 'url': 'http://www.someplace.com/product/12345.html'}] The parameters book_buy_urls and book_buy_url/book_buy_link_text are mutually exclusive. Every element of the list is a dictionary, each consisting of the following fields:
|
||||||||||||||||||||||
book_buy_url: |
optional Values must obey all the conditions
|
||||||||||||||||||||||
book_buy_link_text: |
optional Values must not be longer than 50 |
Additional parameters for type: review_location
evergreen: | The content is an evergreen, i.e. it was not created due to current events and can be read at any time, independent of its issue date. optional |
||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
section_uuid: | The UUID of the section the content object is associated with (None if content object resides outside any section). optional Example value: '12345678-1234-1234-1234-123456789abc' Section with the given UUID must exist in the Metro Publisher instance. |
||||||||||||||||||||||
location_uuid: | The location UUID associated with this content object. optional Example value: '12345678-1234-1234-1234-123456789abc' Location with the given UUID must exist in the Metro Publisher instance. |
||||||||||||||||||||||
blog_uuid: | The UUID of the blog the content object is associated with (None if content object is not part of a blog). optional Example value: '12345678-1234-1234-1234-123456789abc' Values must obey all the conditions
|
||||||||||||||||||||||
rating: | The rating for the object that is being reviewed. optional Values must be any of the following
|
Additional parameters for type: review_movie
evergreen: | The content is an evergreen, i.e. it was not created due to current events and can be read at any time, independent of its issue date. optional |
||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
section_uuid: | The UUID of the section the content object is associated with (None if content object resides outside any section). optional Example value: '12345678-1234-1234-1234-123456789abc' Section with the given UUID must exist in the Metro Publisher instance. |
||||||||||||||||||||||
rating: | The rating for the object that is being reviewed. optional Values must be any of the following
|
||||||||||||||||||||||
movie_title: | The title of the movie that is being reviewed. optional |
||||||||||||||||||||||
movie_image_uuid: | The UUID of the movie cover. optional Example value: '123456578-1234-1234-1234-123456789abc' Values must obey all the conditions
|
||||||||||||||||||||||
movie_issued: | The date when the movie was / is going to be published. This can be some general text, such as 'October 2014', or a date as a string, such as '2014-06-05'. optional |
||||||||||||||||||||||
movie_provider_urls: | A list of Amazon or iTunes urls. optional Example value: ['http://www.amazon.fr/gp/product/B00I9NJG96/', 'http://itunes.apple.com/app/id426698291&mt=8'] Every element of the list must obey all the conditions
|
||||||||||||||||||||||
movie_buy_urls: | A list of dictionaries with url / link text to websites where the movie can be bought. New in MP 3.x: Object Reviews (album, book, product) can now have multiple non-provider buy urls. (also see ChangeLog) optional Example value: [{'link_text': 'Buy at SomePlace', 'url': 'http://www.someplace.com/product/12345.html'}] Every element of the list is a dictionary, each consisting of the following fields:
|
||||||||||||||||||||||
movie_duration: | The movie duration, in minutes. optional |
Additional parameters for type: review_product
evergreen: | The content is an evergreen, i.e. it was not created due to current events and can be read at any time, independent of its issue date. optional |
||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
section_uuid: | The UUID of the section the content object is associated with (None if content object resides outside any section). optional Example value: '12345678-1234-1234-1234-123456789abc' Section with the given UUID must exist in the Metro Publisher instance. |
||||||||||||||||||||||
blog_uuid: | The UUID of the blog the content object is associated with (None if content object is not part of a blog). optional Example value: '12345678-1234-1234-1234-123456789abc' Values must obey all the conditions
|
||||||||||||||||||||||
rating: | The rating for the object that is being reviewed. optional Values must be any of the following
|
||||||||||||||||||||||
product_title: | The title of the product that is being reviewed. optional |
||||||||||||||||||||||
product_image_uuid: | The UUID of the product image. optional Example value: '123456578-1234-1234-1234-123456789abc' Values must obey all the conditions
|
||||||||||||||||||||||
product_issued: | The date when the product was / is going to be released. This can be some general text, such as 'October 2014', or a date as a string, such as '2014-06-05'. optional |
||||||||||||||||||||||
product_provider_urls: | A list of Amazon or iTunes urls. optional Example value: ['http://www.amazon.fr/gp/product/B00I9NJG96/', 'http://itunes.apple.com/app/id426698291&mt=8'] Every element of the list must obey all the conditions
|
||||||||||||||||||||||
product_buy_urls: | A list of dictionaries with url / link text to websites where the product can be bought. New in MP 3.x: Object Reviews (album, book, product) can now have multiple non-provider buy urls. (also see ChangeLog) optional Example value: [{'link_text': 'Buy at SomePlace', 'url': 'http://www.someplace.com/product/12345.html'}] The parameters product_buy_urls and product_buy_url/product_buy_link_text are mutually exclusive. Every element of the list is a dictionary, each consisting of the following fields:
|
||||||||||||||||||||||
product_buy_url: |
optional Values must obey all the conditions
|
||||||||||||||||||||||
product_buy_link_text: |
optional Values must not be longer than 50 |
Additional parameters for type: roundup_content
evergreen: | The content is an evergreen, i.e. it was not created due to current events and can be read at any time, independent of its issue date. optional |
||||||
---|---|---|---|---|---|---|---|
roundup_location_tour_type: | Default type for the Google Directions Service optional Values must be any of the following
|
||||||
roundup_content_targets: | The list of content targets for this roundup. optional Every element of the list is a dictionary, each consisting of the following fields:
|
||||||
roundup_numbering: | The sorting of the list. optional Values must be any of the following
|
Additional parameters for type: roundup_location
evergreen: | The content is an evergreen, i.e. it was not created due to current events and can be read at any time, independent of its issue date. optional |
||||||||
---|---|---|---|---|---|---|---|---|---|
roundup_locations: | The list of locations for this roundup. optional Every element of the list is a dictionary, each consisting of the following fields:
|
||||||||
roundup_location_tour_type: | Default type for the Google Directions Service optional Values must be any of the following
|
||||||||
roundup_location_hide_map: | optional |
||||||||
roundup_numbering: | The sorting of the list. optional Values must be any of the following
|
/{iid}/content/{uuid}/info¶
/{iid}/content/{uuid}/tags¶
GET¶
Get all tags for a content object.
Sample Call¶
>>> GET("/123/content/799d6c73-fe75-11df-837b-001ec21bff9e/tags")
{'items': [{'predicate': 'describes',
'title': 'Sample Tag',
'url': 'https://api.metropublisher.com/123/tags/60183d70-a998-11e1-afa6-0800200c9a66',
'uuid': '60183d70-a998-11e1-afa6-0800200c9a66'},
{'predicate': 'authored',
'title': 'Jane Doe',
'url': 'https://api.metropublisher.com/123/tags/7fbbe910-a998-11e1-afa6-0800200c9a66',
'uuid': '7fbbe910-a998-11e1-afa6-0800200c9a66'}]}
Parameters¶
state: | optional Default: 'approved' if the user is a public user else None. Values must be any of the following
|
---|
/{iid}/content/{uuid}/tags/{predicate}¶
GET¶
Get the tags for a content object that represent a specific tag/content relationship, defined by 'predicate'.
See also tag predicates.
Sample Call¶
Retrieve the author tags, i.e. the tags that define a "tag" -> "authored" -> "object" relationship:
>>> GET("/123/content/799d6c73-fe75-11df-837b-001ec21bff9e/tags/authored")
{'items': [{'predicate': 'authored',
'title': 'Jane Doe',
'url': 'https://api.metropublisher.com/123/tags/7fbbe910-a998-11e1-afa6-0800200c9a66',
'uuid': '7fbbe910-a998-11e1-afa6-0800200c9a66'}]}
Retrieve the tags that define a "tag" -> "describes" -> "object" relationship:
>>> GET("/123/content/799d6c73-fe75-11df-837b-001ec21bff9e/tags/describes")
{'items': [{'predicate': 'describes',
'title': 'Sample Tag',
'url': 'https://api.metropublisher.com/123/tags/60183d70-a998-11e1-afa6-0800200c9a66',
'uuid': '60183d70-a998-11e1-afa6-0800200c9a66'}]}
Parameters¶
state: | optional Default: 'approved' if the user is a public user else None. Values must be any of the following
|
---|
/{iid}/content/{uuid}/slots¶
GET¶
Get the settings of a content object's slots.
New in MP 2.9:
(also see ChangeLog)
Sample Call¶
>>> GET("/123/content/2e06fa2e-008e-11e0-9a76-001ec21bff9e/slots")
{'items': [{'display': 'carousel',
'relevance': 'inline',
'url': 'https://api.metropublisher.com/123/content/2e06fa2e-008e-11e0-9a76-001ec21bff9e/slots/11111111-1111-1111-1111-111111111111',
'uuid': '11111111-1111-1111-1111-111111111111'},
{'relevance': 'aside',
'url': 'https://api.metropublisher.com/123/content/2e06fa2e-008e-11e0-9a76-001ec21bff9e/slots/22222222-2222-2222-2222-222222222222',
'uuid': '22222222-2222-2222-2222-222222222222'}]}
/{iid}/content/{uuid}/slots/{slot_uuid}¶
GET¶
Retrieve settings of one specific slot.
Sample Call¶
>>> GET("/123/content/11111111-1111-1111-1111-111111111111/slots/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa")
{'content_url': 'https://api.metropublisher.com/123/content/11111111-1111-1111-1111-111111111111',
'content_uuid': '11111111-1111-1111-1111-111111111111',
'display': 'gallery',
'relevance': 'inline',
'url': 'https://api.metropublisher.com/123/content/11111111-1111-1111-1111-111111111111/slots/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa',
'uuid': 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'}
/{iid}/content/{uuid}/slots/{slot_uuid}¶
PUT¶
Create/update the information of a slot.
Sending data to this resource does one of two things:
- creates a new slot for the content object if no slot with the given slot id was found for the content object, or
- updates the slot settings for the slot.
Sample Call¶
>>> PUT("/123/content/11111111-1111-1111-1111-111111111111/slots/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",
... {"relevance": "inline",
... "display": "carousel"})
{'content_uuid': '11111111-1111-1111-1111-111111111111',
'slot_uuid': 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa',
'url': 'https://api.metropublisher.com/123/content/11111111-1111-1111-1111-111111111111/slots/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa'}
Parameters¶
relevance: | Relevance of the slot, i.e. how prominently it should be displayed within the content. optional Default: 'aside' Values must be any of the following
|
||||
---|---|---|---|---|---|
display: | Display type of the slot. optional Note required if the parameter relevance is set to 'inline'. Values must be any of the following
|
/{iid}/content/{uuid}/slots/{slot_uuid}¶
DELETE¶
Deletes a slot.
Deleting a slot will also:
- remove any <slot> tags for the given slot id from the content object's content, and
- remove all media information inside the slot.
Sample Call¶
>>> DELETE("/123/content/11111111-1111-1111-1111-111111111111/slots/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa")
{'msg': 'deleted'}
/{iid}/content/{uuid}/slots/{slot_uuid}/media¶
GET¶
Get the media of the slot.
New in MP 2.12:
With 2.12, content objects can have more than one media slot. Use the following resources to manage slots and their media:
- GET /{iid}/content/{uuid}/slots
- GET /{iid}/content/{uuid}/slots/{slot_uuid}
- PUT /{iid}/content/{uuid}/slots/{slot_uuid}
- DELETE /{iid}/content/{uuid}/slots/{slot_uuid}
- GET /{iid}/content/{uuid}/slots/{slot_uuid}/media
- POST /{iid}/content/{uuid}/slots/{slot_uuid}/media
- PUT /{iid}/content/{uuid}/slots/{slot_uuid}/media
Content Media explains the new resources.
(also see ChangeLog)
Sample Call¶
>>> GET("/123/content/11111111-1111-1111-1111-111111111111/slots/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa/media")
{'items': [{'content': '<p>This is an image of the Colosseum.</p>',
'file_mimetype': 'audio/mpeg',
'file_url': 'https://api.metropublisher.com/123/files/a1234567-7255-38bf-83d2-2223728662ae',
'file_uuid': 'a1234567-7255-38bf-83d2-2223728662ae',
'image_mimetype': 'image/jpeg',
'image_url': 'https://api.metropublisher.com/123/files/d16f1ded-7255-38bf-83d2-2223728662ae',
'image_uuid': 'd16f1ded-7255-38bf-83d2-2223728662ae',
'slot_uuid': 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa',
'thumb_mimetype': 'image/jpeg',
'thumb_url': 'https://api.metropublisher.com/123/files/5a778106-5e32-3af2-9bb6-97aeacf01c8e',
'thumb_uuid': '5a778106-5e32-3af2-9bb6-97aeacf01c8e',
'title': 'Media 1',
'type': 'file'},
{'content': None,
'slot_uuid': 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa',
'thumb_mimetype': None,
'thumb_url': None,
'thumb_uuid': None,
'title': 'Media 3',
'type': 'external',
'url': 'http://youtu.be/OSGv2VnC0go',
'url_type': 'youtube'}]}
/{iid}/content/{uuid}/slots/{slot_uuid}/media¶
POST¶
Create new media inside a specific slot of a content object.
This resource creates new media and appends it to the existing list of media in a specific slot of the content object.
New in MP 2.9:
(also see ChangeLog)
Sample Call¶
Adding a file (image) from the Metro Publisher instance's file library:
>>> POST("/123/content/27ba6f3a-ec4a-11e1-82db-001b63a90f63/slots/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa/media",
... {"type": "file",
... "title": "Media 1",
... "content": "<p>This is an image of the Colosseum.</p>",
... "thumb_uuid": "5a778106-5e32-3af2-9bb6-97aeacf01c8e",
... "image_uuid": "d16f1ded-7255-38bf-83d2-2223728662ae"})
{'msg': 'media added'}
Adding a file (audio) from the Metro Publisher instance's file library:
>>> POST("/123/content/27ba6f3a-ec4a-11e1-82db-001b63a90f63/slots/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa/media",
... {"type": "file",
... "title": "Media 1",
... "content": "<p>This is an image of the Colosseum.</p>",
... "thumb_uuid": "5a778106-5e32-3af2-9bb6-97aeacf01c8e",
... "file_uuid": "a1234567-7255-38bf-83d2-2223728662ae"})
{'msg': 'media added'}
Adding an embed (here: YouTube embed code):
>>> POST("/123/content/27ba6f3a-ec4a-11e1-82db-001b63a90f63/slots/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa/media",
... {"type": "embed",
... "title": "Media 2",
... "embed_code": '<iframe width="420" height="315" src="//www.youtube.com/embed/OSGv2VnC0go" frameborder="0" allowfullscreen></iframe>'})
{'msg': 'media added'}
Adding an external asset (here: YouTube link):
>>> POST("/123/content/27ba6f3a-ec4a-11e1-82db-001b63a90f63/slots/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa/media",
... {"type": "external",
... "title": "Media 3",
... "url_type": "youtube",
... "url": "http://youtu.be/OSGv2VnC0go"})
{'msg': 'media added'}
Adding an external asset of the type 'audio' with a list of urls to the audio file in different encodings:
>>> POST("/123/content/27ba6f3a-ec4a-11e1-82db-001b63a90f63/slots/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa/media",
... {"type": "external",
... "title": "Media 4",
... "url_type": "audio",
... "urls": [{"url": "http://www.w3schools.com/html/horse.mp3"},
... {"url": "http://www.w3schools.com/html/horse.ogg",
... "mimetype": "audio/ogg"}]
... })
{'msg': 'media added'}
Parameters¶
type: | The type of the media slot, also please note that there are additional parameters depending on the type specified here required Example value: "file" Values must be any of the following
|
||||||
---|---|---|---|---|---|---|---|
title: | The slide title optional Default: None Example value: "The Colosseum" |
||||||
content: | see HTML-XML optional Default: None Example value: "<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit.<p>" Values must obey all the conditions
|
||||||
thumb_uuid: | UUID of the thumb image. optional Default: None Example value: '123456578-1234-1234-1234-123456789abc' Values must obey all the conditions
|
Additional parameters for type: embed
embed_code: | optional Note required if the parameter type is set to 'embed'. Default: None |
---|
Additional parameters for type: external
image_uuid: | Note Required if type is 'file' and file_uuid is None. If type is 'external', only applies if url_type is 'audio', 'video' or 'youtube'. optional Default: None Example value: '123456578-1234-1234-1234-123456789abc' Values must obey all the conditions
|
||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
url_type: | The type of the external asset, also please note that there are additional parameters depending on the url type specified here optional Note required if the parameter type is set to 'external'. Default: None Example value: "youtube" Values must be any of the following
|
||||||||||
url: | optional Note required if the parameter url_type is set to 'youtube', 'vimeo' or 'soundcloud'. Default: None Example value: "http://youtu.be/OSGv2VnC0go" |
||||||||||
urls: | optional Note required if the parameter url_type is set to 'audio' or 'video'. Default: None Every element of the list is a dictionary, each consisting of the following fields:
|
Additional parameters for type: file
image_uuid: | Note Required if type is 'file' and file_uuid is None. If type is 'external', only applies if url_type is 'audio', 'video' or 'youtube'. optional Default: None Example value: '123456578-1234-1234-1234-123456789abc' Values must obey all the conditions
|
---|---|
file_uuid: | Note Required if type is 'file' and image_uuid is None. optional Default: None Example value: '123456578-1234-1234-1234-123456789abc' Values must obey all the conditions
|
/{iid}/content/{uuid}/slots/{slot_uuid}/media¶
PUT¶
Create/update the media inside the slot.
This resource creates/replaces the media inside the slot.
New in MP 2.12:
With 2.12, content objects can have more than one media slot. Use the following resources to manage slots and their media:
- GET /{iid}/content/{uuid}/slots
- GET /{iid}/content/{uuid}/slots/{slot_uuid}
- PUT /{iid}/content/{uuid}/slots/{slot_uuid}
- DELETE /{iid}/content/{uuid}/slots/{slot_uuid}
- GET /{iid}/content/{uuid}/slots/{slot_uuid}/media
- POST /{iid}/content/{uuid}/slots/{slot_uuid}/media
- PUT /{iid}/content/{uuid}/slots/{slot_uuid}/media
Content Media explains the new resources.
(also see ChangeLog)
Sample Call¶
Set the media for the specific slot:
>>> PUT("/123/content/11111111-1111-1111-1111-111111111111/slots/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa/media",
... {'items': [{"type": "file",
... "title": "Media 1",
... "content": "<p>This is an image of the Colosseum.</p>",
... "image_uuid": "d16f1ded-7255-38bf-83d2-2223728662ae",
... "thumb_uuid": "5a778106-5e32-3af2-9bb6-97aeacf01c8e"},
... {"type": "file",
... "title": "Audio 1",
... "content": "<p>This is a short audio file.</p>",
... "file_uuid": "a1234567-7255-38bf-83d2-2223728662ae",
... "thumb_uuid": "5a778106-5e32-3af2-9bb6-97aeacf01c8e"},
... {"type": "external",
... "title": "Media 3",
... "url_type": "youtube",
... "url": "http://youtu.be/OSGv2VnC0go"}]})
{'msg': 'media updated'}
Remove all media from the specific slot:
>>> PUT("/123/content/11111111-1111-1111-1111-111111111111/slots/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa/media",
... {'items': []})
{'msg': 'media updated'}
Parameters¶
items: | required Every element of the list is a dictionary, each consisting of the following fields:
Additional parameters for type: embed
Additional parameters for type: external
Additional parameters for type: file
|
---|
/{iid}/content/{uuid}/path_history¶
/{iid}/content/{uuid}/path_history¶
POST¶
Create new path history entry for the content object.
This resource creates a new path history entry and adds it to the existing list of path history entries for the content object.
Sample Call¶
Add a new path history entry:
>>> POST("/123/content/2e06fa2e-008e-11e0-9a76-001ec21bff9e/path_history",
... {"path": "/old/path/to/content/index.html"})
{'msg': 'path added'}
Parameters¶
path: | The unquoted, utf-8-decoded old path to the content object. required Example value: "/old/path/to/content/index.html" must be an absolute path |
---|
/{iid}/content/{uuid}/path_history¶
PUT¶
Create/update the path_history of the content object.
This resource creates/replaces the path_history of the content object.
Sample Call¶
Set the path history of a content object:
>>> PUT("/123/content/27ba6f3a-ec4a-11e1-82db-001b63a90f63/path_history",
... {'items': [{"path": "/articles/my_article.html"},
... {"path": "/section/subsection/article/"}]})
{'msg': 'path history updated'}
Remove a content object's path history:
>>> PUT("/123/content/27ba6f3a-ec4a-11e1-82db-001b63a90f63/path_history",
... {'items': []})
{'msg': 'path history updated'}
Parameters¶
items: | required Every element of the list is a dictionary, each consisting of the following fields:
|
---|