{"metadata":{"image":[],"title":"","description":""},"api":{"url":"/account/campaigns/:search","auth":"required","method":"get","params":[{"name":"search","type":"string","default":"PRIMARY","desc":"Search by campaign name or campaignId","required":false,"in":"path","ref":"","_id":"57913210affd0429005fee3d"},{"name":"format","type":"string","default":"json","desc":"Lowercase format of response: json or xml","required":false,"in":"query","ref":"","_id":"5791401f98f30f0e0053afdb"},{"name":"callback","type":"string","default":"NULL","desc":"JSON-P callback method name","required":false,"in":"query","ref":"","_id":"5791403a180e233400f70eed"},{"name":"rowsPerPage","type":"int","default":"100","desc":"The total number of records to return per page","required":false,"in":"query","ref":"","_id":"5bff062c10ad400019e03520"},{"name":"page","type":"int","default":"","desc":"When results are greater than rowsPerPage, allows you to grab the next page of results","required":false,"in":"query","ref":"","_id":"5bff062c10ad400019e0351f"}],"results":{"codes":[{"name":"","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","language":"json","status":200},{"name":"","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}","language":"json","status":401},{"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}","language":"json","status":500}]},"settings":"57717d5327a5c20e00030dbd","examples":{"codes":[{"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":"php"},{"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":"ruby"},{"code":"curl -i -X GET -H \"Authorization: secret {SECRET KEY}\" 'https://rest.viglink.com/api/account/campaigns'","language":"curl"}]}},"next":{"description":"","pages":[]},"title":"Campaigns","type":"endpoint","slug":"campaigns","excerpt":"Get a list of campaigns, or search for a specific campaign by name or campaignId.","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.","updates":["57f286f7130b941700a4bcd8","59dad701f07c79001a1fc5bb","59f3fea589b35600262634f5","5a06d20a34873d0010b39dda","5b1a44405952df0003e8b98f","5b71c46d1dd997000395e44b","5b72d4f326bf7700030e42df","5b74fab8d57689000382e86c","5c494e40f9b7e30057212d30","5c494e64ef9d85002d0d001b","5c70a64fd69c39001eccfab1"],"order":1,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"57912e78f0c7242b005a703b","githubsync":"","user":"568af6d197d8960d0012ab7d","version":{"version":"1.0","version_clean":"1.0.0","codename":"","is_stable":true,"is_beta":false,"is_hidden":false,"is_deprecated":false,"categories":["568af725176a6c0d00a29ec8","56d9d397337fd11300d6a3e3","56d9d4287222d50b0070160b","56f424307ea0091700f63ac5","56f45babcb0dce29005a8e85","5739e5836c5ba134007a197d","57717aee3dd24019004c9122","5771b5d8c755ca0e00617d7d","579639964913990e001a5911","57e57e7df3d7fc0e009c5119","587569b6f4483a0f00d2e6b8","5ca3c2274439e800149daf96"],"_id":"568af725176a6c0d00a29ec7","project":"568af724176a6c0d00a29ec4","releaseDate":"2016-01-04T22:50:13.289Z","__v":12,"createdAt":"2016-01-04T22:50:13.289Z"},"__v":24,"category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"Account","slug":"account","order":0,"from_sync":false,"reference":false,"_id":"5771b5d8c755ca0e00617d7d","project":"568af724176a6c0d00a29ec4","createdAt":"2016-06-27T23:25:12.392Z","__v":0,"version":"568af725176a6c0d00a29ec7"},"project":"568af724176a6c0d00a29ec4","createdAt":"2016-07-21T20:20:08.676Z","parentDoc":null}

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
rowsPerPage:
integer100
The total number of records to return per page
page:
integer
When results are greater than rowsPerPage, allows you to grab the next page of results

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 }}