{"_id":"57912e78f0c7242b005a703b","user":"568af6d197d8960d0012ab7d","version":{"_id":"568af725176a6c0d00a29ec7","project":"568af724176a6c0d00a29ec4","__v":11,"createdAt":"2016-01-04T22:50:13.289Z","releaseDate":"2016-01-04T22:50:13.289Z","categories":["568af725176a6c0d00a29ec8","56d9d397337fd11300d6a3e3","56d9d4287222d50b0070160b","56f424307ea0091700f63ac5","56f45babcb0dce29005a8e85","5739e5836c5ba134007a197d","57717aee3dd24019004c9122","5771b5d8c755ca0e00617d7d","579639964913990e001a5911","57e57e7df3d7fc0e009c5119","587569b6f4483a0f00d2e6b8"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"__v":16,"category":{"_id":"5771b5d8c755ca0e00617d7d","project":"568af724176a6c0d00a29ec4","__v":0,"version":"568af725176a6c0d00a29ec7","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-06-27T23:25:12.392Z","from_sync":false,"order":0,"slug":"account","title":"Account"},"project":"568af724176a6c0d00a29ec4","parentDoc":null,"updates":["57f286f7130b941700a4bcd8","59dad701f07c79001a1fc5bb","59f3fea589b35600262634f5","5a06d20a34873d0010b39dda"],"next":{"pages":[],"description":""},"createdAt":"2016-07-21T20:20:08.676Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"method":"get","results":{"codes":[{"status":200,"language":"json","code":"\n{\n    \"campaigns\":[\n        {\n            \"campaignId\":9876543,\n            \"apiKey\":\"098f6bcd4621d373cade4e832627b4f6\",\n            \"name\":\"PRIMARY\",\n            \"approvalStatus\":\"Approved\",\n            \"category\":\"Sports & Fitness\",\n            \"platform\":\"WordPress\",\n            \"applicationType\":\"Blog\"\n        },\n        {\n            \"campaignId\":9876544,\n            \"apiKey\":\"fb469d7ef430b0baf0cab6c436e70375\",\n            \"name\":\"apparelblog.com\",\n            \"approvalStatus\":\"Approved\",\n            \"category\":\"Apparel & Accessories\",\n            \"platform\":\"WordPress\",\n            \"applicationType\":\"Blog\"\n        },\n    ]\n}\n","name":""},{"status":401,"language":"json","code":"{\n    \"error\": {\n        \"errors\": [\n            {\n                \"reason\": \"invalidCredentials\",\n                \"message\": \"Authorization secret is missing or invalid. This can be found at https://publishers.viglink.com/account and can be sent as a parameter or Authorization header\",\n                \"locationType\": \"parameter\",\n                \"location\": \"secret\"\n            }\n        ]\n    },\n    \"code\": 401,\n    \"message\": \"Authorization secret is missing or invalid. This can be found at https://publishers.viglink.com/account and can be sent as a parameter or Authorization header\"\n}","name":""},{"status":500,"language":"json","code":"{\n    \"error\": {\n        \"errors\": [\n            {\n                \"reason\": \"internalServerError\",\n                \"message\": \"An unexpected error occurred, but we are looking into it\"\n            }\n        ]\n    },\n    \"code\": 500,\n    \"message\": \"An unexpected error occurred, but we are looking into it\"\n}"}]},"settings":"57717d5327a5c20e00030dbd","examples":{"codes":[{"language":"php","code":"<?php\n$ch = curl_init(\"https://rest.viglink.com/api/account/campaigns\");\n\ncurl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: secret YOUR SECRET KEY'));\n\ncurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n$response = curl_exec($ch);\n\ncurl_close($ch);"},{"language":"ruby","code":"require 'httparty'\n\nurl = \"https://rest.viglink.com/api/account/campaigns\"\n\nheaders = {Authorization: \"secret {SECRET KEY}\"}\n\nresponse = HTTParty.get(url, headers: headers)"},{"language":"curl","code":"curl -i -X GET -H \"Authorization: secret {SECRET KEY}\" 'https://rest.viglink.com/api/account/campaigns'"}]},"auth":"required","params":[{"_id":"57913210affd0429005fee3d","ref":"","in":"path","required":false,"desc":"Search by campaign name or campaignId","default":"PRIMARY","type":"string","name":"search"},{"_id":"5791401f98f30f0e0053afdb","ref":"","in":"query","required":false,"desc":"Lowercase format of response: json or xml","default":"json","type":"string","name":"format"},{"_id":"5791403a180e233400f70eed","ref":"","in":"query","required":false,"desc":"JSON-P callback method name","default":"NULL","type":"string","name":"callback"}],"url":"/account/campaigns/:search"},"isReference":false,"order":1,"body":"[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Authorization Header\",\n  \"body\": \"You must add authorization headers to this request.\\n```Authorization: secret {SECRET KEY}```\\n\\n<b>Replace {SECRET KEY} above with any secret key from any campaign in your account.</b> You can find a secret key in your [VigLink account](https://publishers.viglink.com/account). When logged into your dashboard, go to Manage > Account. Under the My Campaign sub-heading, copy a Secret Key. If you don’t have one, click “Get a Secret Key\\\" on any of your campaigns.\"\n}\n[/block]\nUse this endpoint to get a list of your campaigns, or search for a specific campaign by name or campaignId.","excerpt":"Get a list of campaigns, or search for a specific campaign by name or campaignId.","slug":"campaigns","type":"endpoint","title":"Campaigns"}

getCampaigns

Get a list of campaigns, or search for a specific campaign by name or campaignId.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Path Params

search:
stringPRIMARY
Search by campaign name or campaignId

Query Params

format:
stringjson
Lowercase format of response: json or xml
callback:
stringNULL
JSON-P callback method name

Examples


Result Format


Documentation

[block:callout] { "type": "warning", "title": "Authorization Header", "body": "You must add authorization headers to this request.\n```Authorization: secret {SECRET KEY}```\n\n<b>Replace {SECRET KEY} above with any secret key from any campaign in your account.</b> You can find a secret key in your [VigLink account](https://publishers.viglink.com/account). When logged into your dashboard, go to Manage > Account. Under the My Campaign sub-heading, copy a Secret Key. If you don’t have one, click “Get a Secret Key\" on any of your campaigns." } [/block] Use this endpoint to get a list of your campaigns, or search for a specific campaign by name or campaignId.

User Information

Try It Out

get
{{ tryResults.results }}
Method{{ tryResults.method }}
Request Headers
{{ tryResults.requestHeaders }}
URL{{ tryResults.url }}
Request Data
{{ tryResults.data }}
Status
Response Headers
{{ tryResults.responseHeaders }}