SFMC APIs - REST API Calls from SSJS Part 1

แชร์
ฝัง
  • เผยแพร่เมื่อ 30 ต.ค. 2024

ความคิดเห็น • 8

  • @daryldomimicapostol4799
    @daryldomimicapostol4799 ปีที่แล้ว

    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.

  • @formulafunn
    @formulafunn 2 ปีที่แล้ว

    can we have this code in a 'Script Activity' to make the API Calls automated ?

    • @sfmctrailblazers
      @sfmctrailblazers  2 ปีที่แล้ว

      Yes you can have Api call in ssjs script activity

  •  3 ปีที่แล้ว

    Could I list the whole campaigns of a child BU using by SSJS and REST API calls ?

    • @sfmctrailblazers
      @sfmctrailblazers  3 ปีที่แล้ว +1

      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