Difference between revisions of "Geoblocking API"

From DocuWiki
(Request URL)
 
(6 intermediate revisions by one user not shown)
Line 4: Line 4:
 
== Get ==
 
== Get ==
 
== Post ==
 
== Post ==
 +
Allows the creation of rules to limit a video's audience based on geographic location determined by the viewers' IP address.
 +
 +
=== Request URL===
 +
http://console.247platform.com/api/geoblocking/post/[Video Id]/?sesionId=[Session ID]&userId=[Client ID]
 +
 +
=== Parameters ===
 +
* `check`, (String), Required,
 +
* `value`, (String), Required,
 +
* `order`, (Integer), Required,
 +
 +
=== Response ===
 +
 +
=== Errors ===
 +
* ResourceNotFound , 404, Details or video was missing or not found on the request.
 +
 
== Delete ==
 
== Delete ==
 
== Setprofile ==
 
== Setprofile ==
 
== IsAllowed ==
 
== IsAllowed ==
 
== Exclude ==
 
== Exclude ==
 +
Creates an exclusion area geographically around a video,  uses Latitude and Longitude and a distance radius to define if videos inside or outside of that radius are allowed.
 +
 +
=== Request URL ===
 +
http://platform.lan/api/geoblocking/exclusionzone/[Video Id]?streamName=[Stream Name]&exclusionJson=[Exclusion JSON]&userId=[User Id]
 +
 +
=== Params ===
 +
* `videoId`, (integer) (required) Video Id we're applying the rules too
 +
* `streamName` (String) (Required) Stream name of the video, e.g. ab-1234-live
 +
* `exclusionJson` (String) (Required) JSON object containing the details of the exclusion rule
 +
** `lat` - Float , The latitude of the centre point
 +
** `long`, Float,  The longitude of the centre point
 +
** `distance`, Float,  The distance from the centre point in miles that the exclusion zone is in effect
 +
** `direction`, String, Ether ''inside'' or ''outside'', defines if those inside or outside of the zone are excluded. 
 +
 +
=== Example ===
 +
To create  a rule where only people inside a 30 mile radius of a point are allowed to view a video, the ''exclusionJson'' would look like the following:
 +
{
 +
  "lat":"52.3588",
 +
  "long":"-1.7276",
 +
  "distance":30,
 +
  "direction":"outside"
 +
}
  
 +
=== Response ===
 +
{
 +
  "message":"Exclusion rule created",
 +
  "code":"200",
 +
  "isOk":true
 +
}
  
 +
=== Errors ===
 +
* ResourceNotFound (404)
 +
* MissingRequiredJsonValue (400)  - there are missing elements from the ''exclusionJson'' param.
 
[[Category:API]]
 
[[Category:API]]

Latest revision as of 13:23, 26 February 2014

Location API allows you to perform various checks against a viewers' IP address in order to ensure that they would be able to view content in a given region.


Get

Post

Allows the creation of rules to limit a video's audience based on geographic location determined by the viewers' IP address.

Request URL

http://console.247platform.com/api/geoblocking/post/[Video Id]/?sesionId=[Session ID]&userId=[Client ID]

Parameters

  • `check`, (String), Required,
  • `value`, (String), Required,
  • `order`, (Integer), Required,

Response

Errors

  • ResourceNotFound , 404, Details or video was missing or not found on the request.

Delete

Setprofile

IsAllowed

Exclude

Creates an exclusion area geographically around a video, uses Latitude and Longitude and a distance radius to define if videos inside or outside of that radius are allowed.

Request URL

http://platform.lan/api/geoblocking/exclusionzone/[Video Id]?streamName=[Stream Name]&exclusionJson=[Exclusion JSON]&userId=[User Id]

Params

  • `videoId`, (integer) (required) Video Id we're applying the rules too
  • `streamName` (String) (Required) Stream name of the video, e.g. ab-1234-live
  • `exclusionJson` (String) (Required) JSON object containing the details of the exclusion rule
    • `lat` - Float , The latitude of the centre point
    • `long`, Float, The longitude of the centre point
    • `distance`, Float, The distance from the centre point in miles that the exclusion zone is in effect
    • `direction`, String, Ether inside or outside, defines if those inside or outside of the zone are excluded.

Example

To create a rule where only people inside a 30 mile radius of a point are allowed to view a video, the exclusionJson would look like the following:

{
 "lat":"52.3588",
 "long":"-1.7276",
 "distance":30,
 "direction":"outside"
}

Response

{
 "message":"Exclusion rule created",
 "code":"200",
 "isOk":true
}

Errors

  • ResourceNotFound (404)
  • MissingRequiredJsonValue (400) - there are missing elements from the exclusionJson param.