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: Fun94nBf4YiaL20hG5np2Ki8mHtm9OCn4R6lPamNM8mNn7YFDRUvZveSbB0n6T" http://API_DOMAIN/rest/v2/video.json

which will return a collection of objects:
[
	...
{
	"id":"2",
	"title":"Video title",
	"short_description":"",
	"description":"",
	"tags":"",
	"available_video":"1",
	"invalid_video" : "0",
	"created_at":"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" -H "Content-Type:application/json" -H "access-token: [your-access-token]" -X POST http://API_DOMAIN/rest/v2/video.json -d '
{
	"title": "Video title",
	"video": "http://storage.video/video_source.mp4",
	"preview_image": "http://storage.image/test_image.jpg"
}
'
			
The examples in this guide may not include the addition of the access-token parameter in the Headers, but it is always required otherwise the authorization will fail.
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",
	"title":"Video title",
	"short_description":"",
	"description":"",
	"tags":"",
	"available_video":"1",
	"invalid_video" : "0",
	"created_at":"2012-09-25 17:55:47",
	"preview_image":"http:\/\/example.com\/meride\/video\/images\/test_image.jpg"
}