Thank you so much for this! Im doing a Mobile Connect subscription in cloud page via rest API. Thanks for this contribution Once I finish it I will be sharing it back to the community as well the solution I have done.
Yes - you can use the /hub/v1/campaigns route to get the campaign collection for each BU (MID) - ensure that you specify the MID of the BU in the payload when requesting the access token. There's a json key called "account_id" - you can specify the Child BU MID value for this key when requesting the access token and then use this token when running the REST API request for the Get Campaigns Collection.
3 ปีที่แล้ว
@@sfmctrailblazers Thank for your answer. Sorry to ask again, but I am facing an issue during the get of token. URL : auth.exacttargetapis.com/v1/requestToken Method : POST Header : Content-Type=application/json Body : { "grant_type": "client_credentials", "clientId": "", "clientSecret": "", "account_id": "" } Response : { "message": "Unauthorized", "errorcode": 1, "documentation": "" }
3 ปีที่แล้ว
Ok, found it, using /v2/token/ url and adding a scope
Thank you so much for this! Im doing a Mobile Connect subscription in cloud page via rest API. Thanks for this contribution Once I finish it I will be sharing it back to the community as well the solution I have done.
Nice - thank you Daryl 👍
can we have this code in a 'Script Activity' to make the API Calls automated ?
Yes you can have Api call in ssjs script activity
Could I list the whole campaigns of a child BU using by SSJS and REST API calls ?
Yes - you can use the /hub/v1/campaigns route to get the campaign collection for each BU (MID) - ensure that you specify the MID of the BU in the payload when requesting the access token. There's a json key called "account_id" - you can specify the Child BU MID value for this key when requesting the access token and then use this token when running the REST API request for the Get Campaigns Collection.
@@sfmctrailblazers Thank for your answer. Sorry to ask again, but I am facing an issue during the get of token. URL : auth.exacttargetapis.com/v1/requestToken
Method : POST
Header : Content-Type=application/json
Body : {
"grant_type": "client_credentials",
"clientId": "",
"clientSecret": "",
"account_id": ""
}
Response :
{
"message": "Unauthorized",
"errorcode": 1,
"documentation": ""
}
Ok, found it, using /v2/token/ url and adding a scope