popand / adminclient

admin client interface
0 stars 0 forks source link

Creating / Updating product #1

Open popand opened 8 years ago

popand commented 8 years ago

To keep things easier when creating or updating a product, just update the following fields:

Create Product: http://54.84.159.179:8765/productservice/v1/admin/products

Update Product: http://54.84.159.179:8765/productservice/v1/admin/products/{productId}

Request:

{
  "bindId": "ap31",
  "studio": null,
  "longDescription": "The story centers on Charlie, a Los Angeles billionaire financial whiz who goes into self-imposed exile in Tijuana after his empire is revealed to have been a Ponzi scheme. While looking for the woman he abandoned there 25 years before, Charlie is pursued by a Mexican gangster, a federal agent and thugs sent by a former client looking to retrieve his money.",
  "country": "USA",
  "directors": [
    "R. Ellis Frazier"
  ],
  "rating": "R",
  "subtitleList": [],
  "shortTitle": "Across the Line: The Exodus of Charlie Wright",
  "title": "Across the Line: The Exodus of Charlie Wright",
  "blackoutWindowStart": null,
  "blackoutWindowEnd": null,
  "network": null,
  "contentProvider": "AUE",
  "requiredAddonIds": null,
  "genres": [],
  "tags":[],
  "releaseYear": "2010",
  "productType": "Movie",
  "seoUrl": "",
  "languages": [],
  "requiredPackageId": "000001",
  "ratingReason": null,
  "writers": [
    "R. Ellis Frazier"
  ],
  "shortDescription": "The story centers on Charlie, a Los Angeles billionaire financial whiz who goes into self-imposed exile in Tijuana after his empire is revealed to have been a Ponzi scheme. While looking ...",
  "runningTime": "01:34:00",
  "producers": [
    "Jacov Bresler",
    "Bob Dziadkowiec",
    "Moctesuma Esparza",
    "R. Ellis Frazier",
    "Jose Martinez Jr.",
    "Ray Mortier"
  ],
  "boxOfficeGross": "",
  "actors": [
    "Armand Smith",
    "Aidan Quinn",
    "Andy Garcia",
    "Mario Van Peebles"
  ],
  "blackoutIndicator": "False",
  "criticId": null,
  "comingSoon": false,
  "closedCaption": "False",
  "averageUserRating": "6",
  "altCode": "",
  "deliveryTypes": [],
  "canWatchNow": false
}

image

Then when dealing with images, previews, videos and purchase options, please use the following apis:

Add Image: image

http://54.165.55.11:8765/productservice/v1/admin/products/{productId}/image

{
      "imageWidth": 214,
      "imageURL": "https://s3.amazonaws.com/libertas/e35a5f7d-11c4-4832-9bb7-5972089fcd5f/acrosstheline_boxcover.jpg",
      "imageType": "CoverImage",
      "imageHeight": 317
}

Add Preview:

image

http://54.165.55.11:8765/productservice/v1/admin/products/{productId}/preview

{
      "screenFormat": "Wide Screen",
      "aspectRatio": "16:9",
      "mediaFormat": "HLS",
      "targetDevice": "IOS",
      "url": "http://fenkamlibertas1.origin.mediaservices.windows.net/7d2f08f7-dfaf-476a-86c2-fcb6c156ece0/acrosstheline_trailer-m3u8-aapl.ism/manifest(format=m3u8-aapl)"
    }

Add Video: image

http://54.165.55.11:8765/productservice/v1/admin/products/{productId}/video

{
      "screenFormat": "Wide Screen",
      "aspectRatio": "16:9",
      "mediaFormat": "HLS",
      "targetDevice": "IOS",
      "url": "http://fenkamlibertas1.origin.mediaservices.windows.net/7d2f08f7-dfaf-476a-86c2-fcb6c156ece0/acrosstheline_movie-m3u8-aapl.ism/manifest(format=m3u8-aapl)"
}

Add offer (purchaseOption):

image

http://54.165.55.11:8765/productservice/v1/admin/products/{productId}/offer

{
  "regex": ".*SD.*",
  "offerType": "rent",
  "price": "2.99",
  "startDateTimestampMillis": "1397240011406",
  "endDateTimestampMillis": "13972940011406",
  "entitlementDurationMillis": "2400000",
  "name": "testoffer1",
  "mediaList": [
    {
      "mediaId": "5643e59d235ab841f8264354",
      "componentId": null,
      "screenFormat": "Wide Screen",
      "aspectRatio": "16:9",
      "mediaFormat": "HLS",
      "targetDevice": "IOS"
    }
  ],
  "offerId": "4e3157d7-a93d-4525-a910-6c4781e2b5ed"
}
meowcoder commented 8 years ago
// /productservice/v1/products/retrieveAllProductDetail:
{
    "content": [/* skipped */],
    "last": true,
    "totalElements": 10,
    "totalPages": 1,
    "sort": null,
    "numberOfElements": 10,
    "first": true,
    "size": 0,
    "number": 0
}

It shows that it's the last page and there are only 10 total elements, when there are actually 19.