GET Retrieve a list of campaigns in your account.
GET /hub/v1/campaigns/
Operation ID: getCampaigns.
Required permission scope: Campaign > Read
Parameters
Authorization(header, string, required) A unique, time-limited token that you can use to issue requests to REST API. ReplaceYOUR_ACCESS_TOKENwith your authentication token.Example
Bearer YOUR_ACCESS_TOKEN$page(query, string) The page of results to retrieve. Each page includes the number of records specified by the$pageSizeparameter. You can retrieve additional pages by incrementing this number in subsequent calls.$pageSize(query, number) The number of records to return on each page of results. The default value is 25.$orderBy(query, string) The field and sort method to use to sort the results. You can sort on these fields:modifiedDate,createdDate,name, andid. You can sort these fields in ascending (ASC) or descending (DESC) order. The default value is 'modifiedDate DESC'.
Responses
- 200
Indicates that the request to retrieve campaigns was successful.
Media type:
application/json. Schema:campaignsGetResponseBody.Example
{ "count": 1, "page": 1, "pageSize": 50, "links": { "self": { "href": "/v1/campaigns" } }, "items": [ { "createdDate": "2023-08-05T11:18:43", "modifiedDate": "2023-08-05T11:18:43", "id": "1", "name": "Final Hours for Summer Sale", "description": "Invite our most engaged customers to shop our Summer Sale before it ends.", "campaignCode": "summer2023", "color": "800080", "favorite": false } ] } - 400
Indicates that the request contained information that the API couldn’t process. If you receive a 400 response, verify that the request uses the correct syntax.
Media type:
application/json. Schema:errorResponseBody.Example
{ "message": "JSON Deserialization Exception: Location Unknown", "errorcode": 10004, "documentation": "" } - 401
Indicates that the API wasn’t able to authorize your request. If you receive a 401 response, verify that you obtained an authorization token and that the token is still valid.
Media type:
application/json. Schema:errorResponseBody.Example
{ "documentation": "https://developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/error-handling.htm", "errorcode": 0, "message": "Not Authorized" } - 403
This response indicates that the API accepted your request but couldn’t authorize it. If you receive a 403 response, make sure that you have the necessary permission scope for the operation. You can modify permission scopes on the Installed Apps page in Marketing Cloud Engagement Setup.
Media type:
application/json. Schema:errorResponseBody.Example
{ "documentation": "", "errorcode": 20002, "message": "Insufficient privileges to complete this action." } - 500
Indicates that the API encountered an error when processing the request. If you receive a 500 response, verify that the request uses the correct syntax.
Media type:
application/json. Schema:errorResponseBody.Example
{ "documentation": "https://developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/error-handling.htm", "errorcode": 0, "message": "Internal Server Error" }