PrePositioning ingest API documentation

Document created by Akhil Jayaprakash Employee on Apr 9, 2016
Version 1Show Document
  • View in full screen mode

 

1

INTRODUCTION

 

This document lists the API to Create and Delete Generic Content from the REST Ingest API. The Create API creates content for one or more segments.  The corresponding Delete API deletes content from a given segment.

 

Content created via the Create API is active till it is deleted via the Delete API. Multiple Create API invocations for the same segment will add additional content to the segment.

 

Content can be specified as standalone content or with a parent/child relationship.

 

 

 

CREATE GENERIC CONTENT API

 

 

The Create Generic Content API creates content for one or more segments. The same set of content can be sent to multiple segments. Alternatively, different sets of content can be sent to different segments. This makes the API extremely flexible.

 

 

API SIGNATURE

 

 

POST http://{portalAddress}/mnoportal/api/v1/mnos/{mnoSeq}/content/generic/providers/{providerId}/

 

{mnoSeq}  : unique identifier for the Customer. if you need to know your unqiue identifier please mail Akhil (ajayapra@akamai.com)

{providerId} : provider identifier

 

The contents to create are part of the JSON body. The structure of the body is as follows:

 

[

{

"segments": [

“type”: “array”,

"items": {

      “type”: “string”

      },

      “minItems”: 0,

      “uniqueItems”: true

],

"genericContents": [

       “description”: “List of contents”

{

"url": {“type”: “string”},

"type": {“type”: “string”},

"length": {“type”: “number”},

"categories": {“type”: “array”,

                       “items”: {“type”: “string”}

                      }

"contents": [

          “description”: “Optional child contents”

{

"url": {“type”: “string”},

"type": {“type”: “string”},

  "length": {“type”: “number”},

  "categories": {“type”: “array”,

                       “items”: {“type”: “string”}

                      }

},

       }

    }

  ]

 

Note that multiple segments can be specified with multiple segments containing either the same set of contents or different sets of contents.

 

RESPONSE

 

The API returns 201 CREATED

 

EXAMPLES

 

  1. 1 ) This example creates the list of contents specified to segment sales and deals.

 

POST {suffix}/api/v1/mnos/5/provider/ProviderName

[

{

"segments": [

"sales",

"deals"

],

"genericContents": [

{

        “url”": "http://www.parent1.com",

"type": "application/html",

"length": 40,

"categories": ["Sports"],

"contents": [

{

"url": "http://www.child1.1.com",

"length": 40,

"type": "application/html",

"categories": ["Sports"]

},

{

"url": "http://www.child1.2.com",

"length": 40,

"type": "application/html",

"categories": ["Sports"]

}

]

},

{

"url":"http://www.parent2.com",

"length": 40,

"type": "application/html",

"categories": ["Sports"],

"contents": [

{

"url": "http://www.child2.1.com",

"length": 40,

"type": "application/html",

"categories": ["Sports"]

}

]

}

]

}

]

 

  1. 2 ) This example creates the list of a single parent contents to segment specials.

 

POST {suffix}/api/v1/mnos/5/provider/ProviderName

[

{

"segments": [

"specials"

],

"genericContents": [

{

        “url”": "http://www.parent1.com",

"type": "application/html",

"length": 40,

"categories": ["Sports"]

 

}

]

  }

]

 

 

 

  1. 3 ) This example creates the separate lists of contents in the sales and specials segments.

 

[

  {

    "segments": [

      "sales"

    ],

    "genericContents": [

      {

        "url": "www.parent1.com",

        "type": "application/html",

        "length": 200,

        "categories": ["Sports"],

        "contents": [

          {

            "url": "www.child1.1.com",

            "length": 40,

            "type": "application/html",

            "categories": ["Sports"]

          },

          {

            "url": "www.child1.2.com",

            "length": 40,

            "type": "application/html",

            "categories": ["Sports"]

          }

        ]

      }

    ]

  },

  {

    "segments": [

      "specials"

    ],

    "genericContents": [

      {

        "url": "www.parent2.com",

        "type": "application/html",

        "length": 200000,

        "categories": ["Sports"],

        "contents": [

          {

            "url": "www.child2.1.com",

            "length": 40,

            "type": "application/html",

            "categories": ["Sports"]

          },

          {

            "url": "www.child2.2.com",

            "length": 40,

            "type": "application/html",

            "categories": ["Sports"]

          },

           {

            "url": "www.child2.3.com",

            "length": 40,

            "type": "application/html",

            "categories": ["Sports"]

          }

        ]

      }

    ]

  }

]

 

4) This example adds a content to All segments

POST {suffix}/api/v1/mnos/5/provider/ProviderName

[

{

"genericContents": [

{

        “url”": "http://www.parent1.com",

"type": "application/html",

"length": 40,

"categories": ["Sports"]

 

}

]

  }

]

 

 

 

DELETE GENERIC CONTENT aPI

 

 

The Delete Generic Content API deletes content from a segment.

 

 

API SIGNATURE

 

 

DELETE http://{portalAddress}/mnoportal/api/v1/mnos/{mnoSeq}/content/generic/providers/{providerId}/

 

{mnoSeq}  : unique identifier for the Customer. if you need to know your unqiue identifier please mail Akhil (ajayapra@akamai.com)

{providerId} : provider identifier

 

The contents to delete are part of the JSON body. The structure of the body is as follows:

[{

"segments":  “type”: “string”,

"contents": “type”: “array”,

{

      “type”: “string”

      }

},

{

"segments":  “type”: “string”,

"contents": “type”: “array”,

{

      “type”: “string”

      }

}]

 

 

Note that a maximum of a single segment can be specified.

A list of content URLs can be specified.

If neither segments nor a list of content urls are specified, all generic content records will be deleted.

 

RESPONSE

 

The API returns 204 NO CONTENT

 

EXAMPLES

 

  1. 1) This example deletes the list of specified contents from segment bigdeals.

 

DELETE {suffix}/api/v1/mnos/5/provider/ProviderName

[{

"segments": "bigdeals"

"contents": ["www.example1.com", "www.example2.com”]

}]

 

  1. 2) This example deletes a single content from two different segment sales.

 

DELETE {suffix}/api/v1/mnos/5/provider/ProviderName

[{

"segments": "sales"

"contents": ["www.example.com"]

},

{

"segments": "marketing"

"contents": ["www.example.com"]

}]

 

 

  1. 3) This example deletes all generic content from null segments. Null segment is an entry just like a single segment, but it is equivalent to all segments.

 

DELETE {suffix}/api/v1/mnos/5/provider/ProviderName

[{

  “segments”:null

}]

 

 

4)This example deletes one generic content from null segments, and two contents from big deals segments.

 

DELETE {suffix}/api/v1/mnos/5/provider/ProviderName

[{

“segments”:null,

“contents”:[“www.example1.com”]

},

{

“segments”:”big deals”,

“contents:[“www.example2.com”, “www.example3.com”]

}]

 

This document was generated from the following discussion: The specified item was not found.

Attachments

    Outcomes