Getting story details
In this example, we’re going to learn how to get the detail of content using its unique identifier (slug
).
Assuming there is a published story with the slug a-handful-of-olympic-and-paralympic-rowing-facts
for the “English” language,
we need to build the request as follows:
GET https://dapi-base-url/v2/content/en-US/stories/a-handful-of-olympic-and-paralympic-rowing-facts
Where dapi-base-url
must be substituted with the absolute URL of the specific Distribution API instance.
As you can see, it is possible to get the detail of content by appending to the list endpoint the unique identifier (slug) of the desired content.
When a story matching the provided slug is found, an output contract similar to the following is shown:
{
"type": "story",
"_translationId": "24904094-67ae-4c04-8ea6-51060a08e6a1",
"_entityId": "1fdd46a6-2e9b-4d9f-8557-88b6bed902f8",
"selfUrl": "https://acme.org/v2/content/en-us/stories/a-handful-of-olympic-and-paralympic-rowing-facts",
"slug": "a-handful-of-olympic-and-paralympic-rowing-facts",
"title": "A handful of Olympic and Paralympic rowing facts",
"tags": [{
"_translationId": "a6f13b8a-cd67-4e9f-82c8-798d47d1c389",
"_entityId": "7458c096-8d65-40a3-b535-f8ba1a08ccfa",
"selfUrl": "https://acme.org/v2/content/en-us/tags/rowing",
"title": "rowing",
"slug": "rowing",
"neutralSlug": "rowing",
"externalSourceReference": {},
"fields": {}
}],
"relations": [{
"type": "customentity",
"_translationId": "df94dabe-91af-4ce9-9e79-643409e26551",
"_entityId": "19da4105-7110-4e9e-b8f0-b1a08ebaec96",
"selfUrl": "https://acme.org/v2/content/en-us/youtubevideos/why-should-i-row",
"title": "Why should I row?",
"slug": "why-should-i-row",
"fields": {
"videoId": "G1EmAFw_wA0"
},
"entityCode": "youtubevideo",
"thumbnail": {
"title": "1 - SN086zQ",
"templateUrl": "https://images.acme.org/media/image/private/{formatInstructions}/forge/yyd4ehfswo7p878drhu4",
"thumbnailUrl": "https://images.acme.org/media/image/private/w_250,h_250,c_thumb,g_auto,q_auto,f_jpg/forge/yyd4ehfswo7p878drhu4",
"format": "jpg",
"overriddenFormats": {},
"slug": "1-sn086zq",
"selfUrl": "https://acme.org/v2/content/en-us/photos/1-sn086zq"
},
"featured": 0,
"context": {
"_translationId": "a6f13b8a-cd67-4e9f-82c8-798d47d1c389",
"_entityId": "7458c096-8d65-40a3-b535-f8ba1a08ccfa",
"selfUrl": "https://acme.org/v2/content/en-us/tags/rowing",
"title": "rowing",
"slug": "rowing",
"neutralSlug": "rowing",
"externalSourceReference": {},
"fields": {}
},
"createdBy": "Frank Becker",
"lastUpdatedBy": "Frank Becker",
"lastUpdatedDate": "2020-05-19T14:14:54.161Z",
"contentDate": "2020-04-06T09:38:24.786Z",
"tags": [{
"_translationId": "a6f13b8a-cd67-4e9f-82c8-798d47d1c389",
"_entityId": "7458c096-8d65-40a3-b535-f8ba1a08ccfa",
"selfUrl": "https://acme.org/v2/content/en-us/tags/rowing",
"title": "rowing",
"slug": "rowing",
"neutralSlug": "rowing",
"externalSourceReference": {},
"fields": {}
}]
}],
"references": {},
"fields": {},
"createdBy": "Frank Becker",
"lastUpdatedBy": "Frank Becker",
"lastUpdatedDate": "2020-07-22T09:25:58.606Z",
"contentDate": "2020-07-21T07:34:19.442Z",
"featured": 0,
"headline": "Interesting facts about rowing in the Olympic games",
"summary": "The familiar story goes that rowing was included at the first Olympic Games in 1896, but due to inclement weather, the rowing races were cancelled. There were only a handful of countries set to participate, among them France, Germany, Italy and Greece, in just four boat classes. While rowing today",
"parts": [{
"type": "photo",
"_translationId": "e69fdc4e-c4ea-415b-aeb3-d1927dfa2bef",
"_entityId": "811f692a-2d5f-418c-b0d7-9b2e907c8d38",
"selfUrl": "https://acme.org/v2/content/en-us/photos/2019-05-29-redgrave-pintest-featured",
"title": "2019-05-29-redgrave-pintest-featured",
"slug": "2019-05-29-redgrave-pintest-featured",
"featured": 0,
"createdBy": "Frank Becker",
"lastUpdatedBy": "Frank Becker",
"lastUpdatedDate": "2020-07-21T07:33:43.554Z",
"contentDate": "2020-07-21T07:33:43.554Z",
"image": {
"title": "2019-05-29-redgrave-pintest-featured",
"templateUrl": "https://images.acme.org/media/image/private/{formatInstructions}/forge/zaxax7s7k6z2lgoyb59x",
"thumbnailUrl": "https://images.acme.org/media/image/private/w_250,h_250,c_thumb,g_auto,q_auto,f_jpg/forge/zaxax7s7k6z2lgoyb59x",
"format": "jpg",
"overriddenFormats": {}
},
"fields": {},
"contextualFields": {},
"tags": []
},
{
"type": "markdown",
"content": "The familiar story goes that rowing was included at the first Olympic Games in 1896, but due to inclement weather, the rowing races were cancelled. There were only a handful of countries set to participate, among them France, Germany, Italy and Greece, in just four boat classes. While rowing today is no stranger to difficult weather conditions, the sport looks quite different. Here are some fun facts about Olympic and Paralympic rowing throughout the last 125 years.",
"contextualFields": {}
},
{
"type": "markdown",
"content": "**_Globalisation_**\n\nOne of the most striking changes has been the globalisation of the sport. With just eight nations participating at the Olympic Games in 1900, when the first rowing medals were awarded, there were 69 participating countries at the 2016 Olympics in Rio. And although the final tally is not yet known for the Tokyo Olympic Games, the number of nations participating in qualification regattas continues to climb. There are now 156 National Federations in the sport of rowing, which has grown by more than 90 nations in the last 30 years.",
"contextualFields": {}
},
{
"type": "markdown",
"content": "**_Women_**\n\nWomen were first included at the 1976 Olympic Games, but women’s participation in the sport can be traced back much farther. The first FISA recognised international race for women was at the 1951 European Rowing Championships and a number of countries had already long-established women’s rowing events. With growing participation at the Olympic level, for the first time in history, women now have an equal number of events at the Olympic Games.",
"contextualFields": {}
},
{
"type": "external",
"externalType": "oembed",
"inputUrl": "https://twitter.com/WorldRowing/status/1285182667953254402",
"content": {
"url": "https://twitter.com/WorldRowing/status/1285182667953254402",
"author_name": "World Rowing",
"author_url": "https://twitter.com/WorldRowing",
"html": "<blockquote class=\"twitter-tweet\" data-lang=\"en\"><p lang=\"en\" dir=\"ltr\">Join in before 31 July and row a piece of 8 minutes and 46 seconds on the erg or on water, and donate what you can to Color of Change through GoFundMe - jump on our FB page to find the link.<a href=\"https://twitter.com/hashtag/ROWERSAGAINSTRACISM?src=hash&ref_src=twsrc%5Etfw\">#ROWERSAGAINSTRACISM</a> <a href=\"https://t.co/NdbhfoaYng\">https://t.co/NdbhfoaYng</a> via <a href=\"https://twitter.com/FacebookWatch?ref_src=twsrc%5Etfw\">@FacebookWatch</a></p>— World Rowing (@WorldRowing) <a href=\"https://twitter.com/WorldRowing/status/1285182667953254402?ref_src=twsrc%5Etfw\">July 20, 2020</a></blockquote>\n<script async src=\"https://platform.twitter.com/widgets.js\" charset=\"utf-8\"></script>\n",
"width": 550,
"type": "rich",
"cache_age": "3153600000",
"provider_name": "Twitter",
"provider_url": "https://twitter.com",
"version": "1.0"
},
"contextualFields": {}
},
{
"type": "markdown",
"content": "**_Para rowing_**\n\nThe rowing family also grew to include para rowing, with the introduction of the sport to the Paralympic Games in Beijing 2008. The four boat classes that raced in 2008 are still on the programme today (although they have since been renamed).",
"contextualFields": {}
},
{
"type": "markdown",
"content": "**_Racing distance_**\n\nBoth para rowing and women’s rowing were first introduced competing over a distance of 1000m, but have since been changed to 2000m. However, the length of rowing courses has been a fluid part of the sport since its inception.\n\nThe standard distance of 2000m was adopted for the 1912 Olympic Games in Stockholm and has been used ever since. For the early Olympic Games, however, the course distances varied from 1750m in Paris 1900 to 3218m in St. Louis 1904 and the Henley Royal Regatta course of 2112m in London 1908 (and again when the course was used in 1948). In the early days, races were also between two to three boats. The six-lane courses were first used in 1936 Olympic Games in Berlin, Germany and became standard since the 1956 Olympic Games in Melbourne, Australia.",
"contextualFields": {}
},
{
"type": "markdown",
"content": "**The speed of racing**\n\nStandardising the distance has allowed for a comparison of speed over time. Tokyo, Japan hosted the Olympic Games in 1964 and the gold medal men’s eight finished in a time of 6:18.23. Over 50 years later, the men’s eight has now set the World Best Time almost one minute faster: 5:18.68. In fact, men’s eights with today’s equipment can reach speeds of up to 25km per hour. In comparison, the men’s 100m athletics time in 1964 was 10.0 seconds, which was a world record. The current world record for the men’s 100m is 9.58 seconds. In rowing, the difference is almost 16 per cent, whereas it is just four per cent in athletics.",
"contextualFields": {}
},
{
"type": "album",
"_translationId": "d30f92af-56f0-4f2d-a1b4-3c521425cf9b",
"_entityId": "b05ce183-6bcc-44f4-bf1c-c057ca28903c",
"selfUrl": "https://acme.org/v2/content/en-us/albums/rowing-album",
"title": "Rowing album",
"slug": "rowing-album",
"thumbnail": {
"title": "1 - SN086zQ",
"templateUrl": "https://images.acme.org/media/image/private/{formatInstructions}/forge/yyd4ehfswo7p878drhu4",
"thumbnailUrl": "https://images.acme.org/media/image/private/w_250,h_250,c_thumb,g_auto,q_auto,f_jpg/forge/yyd4ehfswo7p878drhu4",
"format": "jpg",
"overriddenFormats": {},
"slug": "1-sn086zq",
"selfUrl": "https://acme.org/v2/content/en-us/photos/1-sn086zq"
},
"fields": {},
"contextualFields": {},
"tags": [],
"featured": 0,
"lastUpdatedDate": "2020-07-22T08:58:46.277Z",
"contentDate": "2020-05-28T16:47:54.215Z",
"createdBy": "Frank Becker",
"lastUpdatedBy": "Frank Becker"
},
{
"type": "markdown",
"content": "**_Better backwards_**\n\nRowing also gets to boast that it is the only Olympic sport in which competitors sit facing backwards and rowers use an estimated 86 per cent of their muscles while competing. But these facts will have to hold on one more year until the next edition of the Olympic Games will be written in the history books.",
"contextualFields": {}
}
],
"thumbnail": {
"title": "2019-05-29-redgrave-pintest-featured",
"templateUrl": "https://images.acme.org/media/image/private/{formatInstructions}/forge/zaxax7s7k6z2lgoyb59x",
"thumbnailUrl": "https://images.acme.org/media/image/private/w_250,h_250,c_thumb,g_auto,q_auto,f_jpg/forge/zaxax7s7k6z2lgoyb59x",
"format": "jpg",
"overriddenFormats": {},
"slug": "2019-05-29-redgrave-pintest-featured",
"selfUrl": "https://acme.org/v2/content/en-us/photos/2019-05-29-redgrave-pintest-featured"
}
}
As you can see, the output contract contains all the metadata related to the content.
Additionally, the main metadata of each content that has been embedded (e.g. photos, posts from social networks, albums, etc.)
or related to this story (e.g. tags, relations, etc.) are available as part of this output.
This enables consumers of this contract to have all the needed information in order to present this content to fans.
The following Distribution API endpoints have been used on this workflow;
please refer to the specific endpoint page for an in-depth description of the output contract:
Endpoint | Path | Description |
---|---|---|
Get Story By Slug | /v2/content/{culture}/stories/{slug} | This endpoint returns the detail of a published story |