Skip to content

Instantly share code, notes, and snippets.

@homam
Created September 8, 2014 07:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save homam/085f9b36f4c016117c8a to your computer and use it in GitHub Desktop.
Save homam/085f9b36f4c016117c8a to your computer and use it in GitHub Desktop.
Web Rich Media API - Simple

Web Rich Media Banners API

This API is going to be used in our Web Rich Media Banners. The purpose is to be able to support interstitial interactive banners and get subscribers directly from banners.

JSONP

The Request URL always contains Query String parameter: jsonp.

Response content-type must be: application/javascript.

Response should be generated by a code like:

Response.Write(Request["jsonp"] + "(" + new JavaScriptSerializer().Serialize(model) + ")");

API

Verbs:

  • visit
  • submit
  • pin
  • checkSubscription

visit

Parameters:

  • campaign: Integer
  • page : Integer
  • language: Two-Letter-ISO-Code
  • country : Two-Letter-ISO-Code
  • placementId : String

Response:

  • visitId : Integer

Example:

/visit/?campaign=1736&page=341&language=ar&country=ae&placementId=36adx371f&jsonp=func
func({"visitId": 285466474})

submit

Parameters:

  • visitId : Integer
  • mobile : String
  • operator : Integer?

Response:

  • submissionId : Integer
  • validMSISDN : Boolean
  • pinSent : Boolean

Example:

/submit/?visitId=285466474&mobile=0555268287&jsonp=func
func({"submissionId": 14567889, "validMSISDN": true, "pinSent": true})

pin

Parameters:

  • submissionId : Integer
  • pin : String

Response:

  • pinIsValid : Boolean
  • maxiumumTrialsExceeded? : Boolean

Example:

/pin/?submissionId=14567889&pin=3713&jsonp=func
func({"pinIsValid": true})

checkSubscription

Parameters:

  • submissionId : Integer

Response:

  • subscriberId? : Integer

Example:

/checkSubscription/?submissionId=14567889&jsonp=func
func({}) // waiting
func({"subscriberId": 1247882})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment