VNP Input Webservices - Multimedial Enrichments
automatically enrich a virtual newspaper page with multimedia contents as links, video etc.
The service allow to send a Json structured data containing the multimedia informations.
The Json must be posted to the address //webservice/v3/multimedia
together with some extra parameters:
the private key is a private hashing string that you can find in the VNP backend -> settings -> key codes -> Private Ws Key
The authcode is generated concatenating the token string with the private key, without any space in between.
As first step, you have to decide a token, which should change at every request. Then get the Private WS Key, paste it together with the token, without spaces, and hash it in MD5. The result will be the value for the authCode.
The second step is to create the Json to be posted to the web service URL.
In the Json it's possible to specify three different multimedia "type"
- link : a link to an external URL/web site page that will open in a different tab
- video : a URL pointing to a video that will be embedded in the same page into an overlay window
- jump : a reference to another page also in a different edition
Here is an example of how the URL for the POST should be built:
webservice/v3/multimedia?authCode=your_authcode&token=your_token_string&payload=%7B%22title%22%3A+
%22TORINO%22%2C+%22issue%22%3A%222019-05-29%22%2C+%22data%22%3A+%5B+%7B++%22id%22%3A%229876%22%2C++
%22externalId%22%3A%22aabb%22%2C++%22tooltip%22%3A%22Go+somewhere%22%2C+%22caption%22%3A
%22test_link%22%2C+%22type%22%3A%22link%22%2C++%22data%22%3A++%7B+%22url%22%3A+%22https%3A%2F
%2Fwww.google.com%22%7D%2C++%22coordinates%22%3A+%7B+%22x%22%3A%221%22%2C++%22y%22%3A%221%22%2C+
%22w%22%3A%221%22%2C+%22h%22%3A%221%22++%7D+%7D+%5D%0D%0A%7D
Json strucutre
Below there are sample of Json to handle all three different types. Following is the description of the Json structure.
Te Json "data" item is processed and it will cause a record to be updated or inserted, depending if the provided id already exists or not.
The Json must contain the information to locate the page/edition where the link should be placed together with all multimedia's information and the coordinates for the in-page box (that can be null), like:
Here are some samples
LINK
{"title":"THEDAILY",
"issue":"2019-05-29",
"data":
[
{
"id":"1243",
"page":"5",
"externalId":"3371",
"tooltip":"Click to read the doc",
"caption":"Webservices - Multimedial Enrichments",
"type":"link",
"data":
{
"url": "https://www.virtualacademy.it/news/webservices/3371/webservices---multimedial-enrichments.html?paywall_canRead=true"
},
"coordinates":
{
"x":"1",
"y":"1",
"w":"1",
"h":"1"
}
}
]
}
JUMP
{"title":"THEDAILY",
"issue":"2019-05-29",
"data":
[
{
"id":"1578",
"page":"10",
"externalId":"415765",
"tooltip":"View the last week article",
"caption":"The bus crash in Carnaby street",
"type":"jump",
"data":
{
"title": "THEDAILY",
"issue": "2019-05-22",
"to": "6"
},
"coordinates":
{
"x":"1",
"y":"1",
"w":"1",
"h":"1"
}
}
]
}
VIDEO
{"title":"THEDAILY",
"issue":"2019-05-29",
"data":
[
{
"id":"1876",
"page":"22",
"externalId":"CAgP9fo3f7s",
"tooltip":"View the video",
"caption":"Again wildfire in Yellowstone",
"type":"video",
"data":
{
"url": "https://www.youtube.com/watch?v=CAgP9fo3f7s"
},
"coordinates":
{
"x":"1",
"y":"1",
"w":"1",
"h":"1"
}
}
]
}
| PARAMETER NAME | MANDATORY | VALUE FORMAT | DESCRIPTION | EXAMPLE |
|---|---|---|---|---|
| authCode | Y | string | must contain token+private_key_WS (available on the "Settings" panel of your VirtualNewspaper Back-end). The authCode needs to be provided in md5 format. | |
| token | Y | string | contains a value decided by you, i.e. timestamp | |
| payload | Y | string | see above description |