Search campaigns

POST /campaign/search/{fromthisid}

Limited to those campaigns the user can see. Filtered by the posted fields. Returned in ID order

Path parameters

  • fromthisid integer Required

    The ID that is previous to the one to start from e.g. if IDs are 1,2,3 fromthisid as 1 will return 2,3

application/json

Body

1 or more Search parameters

  • search array[object]
    Hide search attributes Show search attributes object
    • by string

      any of the field names that are output from item or list calls

    • value string

      the search value for the term specified by the 'by'

Responses

  • 200 application/json

    List returned OK

    Hide response attributes Show response attributes object
    • id integer

      Minimum value is 1.

    • name string
    • Optional - the date this campaign started. Format yyyy-mm-dd

    • end_date string

      Optional - the date this campaign finished. Format yyyy-mm-dd

    • Optional - a unique code for this campaign.

    • Optional - links to a campaign type as a way of categorising campaigns

    • If the user is a clustered login, then this must be supplied. Otherwise its optional but must link to a group the login has access to.

  • 401 application/json

    Authentication unauthorised

    Hide response attribute Show response attribute object
  • 403 application/json

    Invalid permission

    Hide response attribute Show response attribute object
POST /campaign/search/{fromthisid}
curl \
 -X POST https://YOURSITE.infoodle.com/apiv2/campaign/search/4 \
 -H "Authorization: Bearer $ACCESS_TOKEN" \
 -H "Content-Type: application/json" \
 -d '{"search":[{"by":"name","value":"Test Item"}]}'
Request examples
{
  "search": [
    {
      "by": "name",
      "value": "Test Item"
    }
  ]
}
Response examples (200)
[
  {
    "id": 123,
    "name": "Donations",
    "description": "All ad-hoc donations generated during the Summer campaign",
    "start_date": "2019-02-13",
    "end_date": "2019-02-13",
    "tracking_tag": "CT5",
    "campaign_type_id": 6,
    "for_group_id": 543
  }
]
Response examples (401)
{
  "error": "Unauthorised"
}
Response examples (403)
{
  "error": "Invalid Permission"
}