Edit Content

This section lets you edit the content.

Authorization

PATCH {API_URL}/content/{contentId}

Client API Key and API Secret must be passed in Authorization Headers using Basic Auth. With API Key as the Username and API Secret as the password.

Path Parameters

NameTypeDescription

contentId*

String

The ID of the Content you wish to edit

Request Body

NameTypeDescription

title

String

Title of the content

contentId

String

contentId of the content

duration

Integer

duration of the content

priv

price of the content

url

String

URL of the content

curl -X PATCH '{API_URL}/api/v1/content/{contentId}' \
-H 'Authorization: Basic RDZXN1Y4US1NTkc0V1lDLVFYOUJQMkItOEU3QjZLRzpUNFNHSjlISDQ3TVpRWkdTWkVGVjZYUk5TS1E4RDZXN1Y4UU1ORzRXWUNRWDlCUDJCOEU3QjZLRw==' \
-H 'Content-Type: application/json' \
-d '{
    "contentId" : "testingID For Client Content",
    "duration" : 30,
    "title" : "Test content for API functionality Edited",
    "price" : 90,
    "currency": "INR",
    "categories": ["category1", "category2"],
    "tags": ["free", "premium", "metered"],
    "sections": ["EDITORIAL"],
    "authorId": "7589",
    "url": "www.google.com",
    "contentType": "PREMIUM CONTENT",
    "priceOverrides": {
        "country": [
            {
                "name": "GL",
                "price": 2
            },
            {
                "name": "IN",
                "price": 1
            },
            {
                "name": "US",
                "price": 0
            }
        ]
    },
    "download": {
      "url": "https://yourdownloadurl.com",
      "fileName": "Download File - Edited Name",
      "fileType": "PDF"
    },
    "pixels": {
        "facebook": {
            "pixelId": "98357934724994",
            "events": [
                {
                    "eventType": "VIEW",
                    "name": "PageView"
                },
                {
                    "eventType": "CONVERSION",
                    "name": "Purchase",
                    "data": {
                        "value": "dataValue"
                    }
                }
            ]
        },
        "google": {
            "trackingId": "G-RJDY8493"
        }
    }
}'

The above command returns JSON structured like this:

{
    "message": "Content Edited Successfully",
    "editedContent": {
        "title": "Test content for API functionality",
        "contentId": "898",
        "price": 90,
        "currency": "INR",
        "duration": 30,
        "url": "www.google.com",
        "contentType": "STORY",
        "authorId": "7589",
        "priceOverrides": {
            "country": [
                {
                    "currency": "INR",
                    "_id": "605b25824646e9233aef61b4",
                    "name": "GL",
                    "price": 3
                },
                {
                    "currency": "INR",
                    "_id": "605b25824646e9233aef61b5",
                    "name": "IN",
                    "price": 5
                },
                {
                    "currency": "INR",
                    "_id": "605b25824646e9233aef61b6",
                    "name": "US",
                    "price": 7
                }
            ]
        },
        "download": {
            "url": "https://www.google.com",
            "fileName": "Download File - Name",
            "fileType": "PDF",
            "s3Key": "stage/Demo Client/Download File - Name-898.pdf"
        },
        "pixels": {
            "facebook": {
                "pixelId": "98357934724994",
                "events": [
                    {
                        "eventType": "VIEW",
                        "name": "PageView"
                    },
                    {
                        "eventType": "CONVERSION",
                        "name": "Purchase",
                        "data": {
                            "value": "dataValue"
                        }
                    }
                ]
            },
            "google": {
                "trackingId": "G-RJDY8493"
            }
        },
        "categories": [
            "category1",
            "category2"
        ],
        "tags": [
            "free",
            "premium",
            "metered"
        ],
        "sections": [
            "EDITORIAL"
        ],
        "publicationDate": null
    }
}

Last updated