How to request Impact

Get Impacts

Returns json data for selected impacts.

    • URL

      /wp-json/mkscta/v1/calls-to-action/

Method:

GET

  • Data Params

    impact_id: <integer>
    impact_ref: <str>
    type: ‘banner’
    quantity: <integer default: 1>

    diffusing-state: distributed || paused
    status: published || draft
    language:  en || fr

    campaign[operator]: AND || IN || NOT IN
    campaign[id]: <coma separated integer list>

    category[operator]: AND || IN || NOT IN
    category[name]: <coma separated string list>

    program[operator]: AND || IN || NOT IN
    program[name]: <coma separated string list>

    Warning:
    If impact_id or impact_ref are specified. All other parameters will be ignore

  • Success Response:
    • Code: 200
      Content: 

 

[{
  target-url: <URL>,
  button-label: <string if specified>,
  title: <String if specified>,
  content: <String if specified>,
  cover: <URL of a cover picture if specified>
}]
  • Sample Call:
      $.ajax({
        url: "http://calltoimpact.org/wp-json/mkscta/v1/calls-to-action/",
        data:{
          "quantity":10,
          "language":"fr",
          "type":"banner",
          "category":
          {
            "operator":"IN",
            "name":"example"
          }
        },
        type : "GET",
        success : function(r) {
          console.log(r);
        }
      });

Leave a Reply

Your email address will not be published. Required fields are marked *