{"_id":"5771b7c045c7080e007292a7","__v":11,"hidden":false,"slug":"account-info","sync_unique":"","editedParams":true,"editedParams2":true,"link_external":false,"link_url":"","updates":["57776742e5682f0e00d51184","58ac2529d5e1570f00d1c118","597b4c0e7bdbc500385969f2","5a3759b524fdd8001c46d237"],"category":"5771b5d8c755ca0e00617d7d","excerpt":"Get your account information and campaign details.","order":0,"parentDoc":null,"project":"568af724176a6c0d00a29ec4","title":"Account Info","user":"568af6d197d8960d0012ab7d","version":"568af725176a6c0d00a29ec7","api":{"results":{"codes":[{"language":"json","code":"\n{\n    \"account\":{\n        \"id\":1234567,\n        \"firstName\":\"John\",\n        \"lastName\":\"Doe\",\n        \"joinDate\":\"2016-01-01 08:00:00\",\n        \"referral\":{\n            \"count\":0,\n            \"revenue\":0\n        }\n    },\n    \"campaigns\":[\n        {\n            \"campaignId\":9876543,\n            \"apiKey\":\"098f6bcd4621d373cade4e832627b4f6\",\n            \"name\":\"JohnDoeBlog.com\",\n            \"approvalStatus\":\"Approved\",\n            \"category\":\"Sports & Fitness\",\n            \"platform\":\"WordPress\",\n            \"applicationType\":\"Blog\"\n        }\n    ]\n}\n","name":"","status":200},{"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":401,"language":"json"},{"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","url":"/account","auth":"required","examples":{"codes":[{"code":"<?php\n$ch = curl_init(\"https://rest.viglink.com/api/account\");\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"},{"language":"ruby","code":"require 'httparty'\n\nurl = \"https://rest.viglink.com/api/account\"\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'"}]},"method":"get","params":[{"_id":"57842adcb3a5402400fee891","ref":"","required":false,"desc":"By default, a list of your campaigns is returned. To return just your account data, send false","default":"TRUE","type":"boolean","name":"includeCampaigns","in":"query"},{"_id":"57842adcb3a5402400fee890","ref":"","required":false,"desc":"Lowercase format of response: json or xml","default":"json","type":"string","name":"format","in":"query"},{"_id":"57842adcb3a5402400fee88f","ref":"","required":false,"desc":"JSON-P callback method name","default":"NULL","type":"string","name":"callback","in":"query"}]},"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 your account information including accountId and each campaignId that can be used for other endpoints.","createdAt":"2016-06-27T23:33:20.278Z","githubsync":"","isReference":false,"type":"get","next":{"pages":[]},"childrenPages":[]}

getAccount Info

Get your account information and campaign details.

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Query Params

includeCampaigns:
booleanTRUE
By default, a list of your campaigns is returned. To return just your account data, send false
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 your account information including accountId and each campaignId that can be used for other endpoints.

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