Starting from version 2.7 Picovico API supports application/json Content-type payload for creating videos. This post explains the major steps required to create a video, starting from the authentication step itself.


Major points to remember throughout the video making process.

  1. Authentication header (X-Access-Key), (X-Access-Token) required in all requests with endpoint having prefix /me
  2. App Header (X-PV-Meta-App) is required in all requests


Step 1 : Getting App ID and developer access.

- Please signup for a developer plan from our pricing page. - (app.picovico.com)

- Access your developer portal from your account settings, and create an app to begin.


Step 2: Authentication

Picovico uses simple authentication with APP_ID, APP_SECRET and DEVICE_ID

curl -X POST \
       -d "app_id=app-id&app_secret=app-secret&device_id=com.yourdomain.picovico' \
       -H "X-PV-Meta-App: some-app-id" \
       https://api2.picovico.com/v2.7/login/app


Step 3: Begin Project / Define

3.a) Build the JSON payload

{
    "style": "vanilla_frameless", 
    "quality": 480, 
    "name": "Picovico API sample", 
    "aspect_ratio": "16:9", 
    "assets": [ 
        { 
            "music": { 
                "asset_id": "aud_6j44J9zjbSQe54ZTTSqUj2"
            }, 
            "frames": [ 
                {
                    "name": "text", 
                    "data": {
                        "title": "Picovico API",
                        "text": "DEMONSTRATION"
                    }
                },                
                {
                    "name": "image", 
                    "url": "https://images.unsplash.com/photo-1481326086332-e77dd61a4ea1", 
                    "data": {
                        "caption": "I look at you and see the rest of my life."
                    }
                }, 
                { 
                    "name": "image", 
                    "url": "https://images.unsplash.com/photo-1495322723012-b324fc191ec9", 
                    "data": {
                        "caption": "All, everything that I understand,
                                    I only understand because I love"
                    }
                }, 
                {
                    "name": "image",
                    "url": "https://images.unsplash.com/photo-1490723186985-6d7672633c86", 
                    "data": {
                        "caption": "I'm much more me when I'm with you"
                    }
                }
            ] 
        } 
    ] 
}


3.b) Create project

curl -X POST \
    -H "X-PV-Meta-App: some-app-id" \
    -H "X-Access-Key: some-access-key" \
    -H "X-Access-Token: some-access-token" \
    -H "Content-Type: application/json" \
    -d "video_definition_json_payload" \
    https://api2.picovico.com/v2.7/me/videos

# Check the response for VIDEO_ID (starts with vid_)


Step 4: Render / Preview

4.a) Preview

curl -X PUT \
    -H "X-PV-Meta-App: some-app-id" \
    -H "X-Access-Key: some-access-key" \
    -H "X-Access-Token: some-access-token" \
    https://api2.picovico.com/v2.7/me/videos/VIDEO_ID/?preview=1

4.b) Render

curl -X PUT \
    -H "X-PV-Meta-App: some-app-id" \
    -H "X-Access-Key: some-access-key" \
    -H "X-Access-Token: some-access-token" \
    https://api2.picovico.com/v2.7/me/videos/VIDEO_ID