Meride API - Presentation - General

The APIs allow you to embed and interact with Meride data in your application. You can upload videos, process embeds, perform searches and much more.

General operations

The Meride APIs allow you to create applications that use the Representational State Transfer software architecture. Currently the only format supported in the replies is JSON


1. Example of READ video with the curl command

Calls must be authorized using an access token. It is therefore useful to read the authorization guide

curl -i -H "Accept: application/json" -H "access_token: ZtJaOVJ14NoeaxiT6lBNza9h8XhQBis5C15gNFeOiTSog18cczQCbQKyDRf70x" http://API_DOMAIN/rest/video.json

which will return a collection of objects:
[
	...
{
	"id":"2",
	"titolo":"Video title",
	"url_flash":"http:\/\/example.com\/z\/video_test.smil\/manifest.f4m",
	"url_iphone":"http:\/\/example.com\/i\/video_test,200,500,1200,.mp4.csmil\/master.m3u8",
	"descrizione_breve":"",
	"descrizione":"",
	"tags":"",
	"video_disponibile":"1",
	"data_inserimento":"2012-09-25 17:55:47",
	"preview_image":"http:\/\/example.com\/meride\/video\/images\/test_image.jpg"
}
	...
]
		    

2. Example of CREATE video with the curl command

curl -i -H "Accept: application/json" -X POST -F "preview_image=@path_and_filename.jpg" -F "video=@path_and_filename.wmv" -F "titolo=Video title" http://API_DOMAIN/rest/video.json

Negli esempi di questa guida può non essere riportata l'aggiunta negli Header del parametro access_token ma è sempre richiesto altrimenti l'autorizzazione fallirà
If, as in this case, you have to insert files, the curl call cannot be made with the -d parameter but you must use the -F parameter separately for each field to be treated
will return the desired object
{
	"id":"2",
	"titolo":"Video title",
	"url_flash":"http:\/\/example.com\/z\/video_test.smil\/manifest.f4m",
	"url_iphone":"http:\/\/example.com\/i\/video_test,200,500,1200,.mp4.csmil\/master.m3u8",
	"descrizione_breve":"",
	"descrizione":"",
	"tags":"",
	"video_disponibile":"1",
	"data_inserimento":"2012-09-25 17:55:47",
	"preview_image":"http:\/\/example.com\/meride\/video\/images\/test_image.jpg"
}