Making API calls on Adobe I/O | Adobe Campaign Standard

AdobeIO

For Adobe Campaign Standard, REST is the only way to perform web service calls. In this post, I will go through the steps you need to do if you want to call an API on Adobe I/O.

Pre-req­ui­sites:

  • You need to be an admin on your Adobe Mar­ket­ing Cloud instance to create Adobe I/O integration
  • In order to make a successful API call on any of the product, you need to have relevant access on individual products (eg: Adobe Campaign, Adobe Analytics etc)
  • Post­Man installed on your sys­tem
  • OpenSSL avail­ability (Win­dows:  you need to install this / Mac: It is available by default)

Step 1: Generating public/private keys (OpenSSL)

You need to be a system admin and also have OpenSSL installed to complete this step successfully.

In OpenSSL, via this com­mand you can gen­er­ate the pub­lic and pri­vate key:

openssl req -nodes -text -x509 -newkey rsa:2048 -keyout secret.pem -out certificate.pem -days 356

This will give you two files:

  • certificate.pem (pub­lic key)
  • secret.pem (pri­vate key)

Important:

  • Never share your private key with anyone.

Step 2: Setup Integration

adobeio-campaign-techonol1

  • Choose “Access an API”

adobeio-campaign-techonol2

  • Select the service you want to inte­grate with (eg: Adobe Campaign)

adobeio-campaign-techonol3

  • When cre­at­ing a new inte­gra­tion, then choose “New inte­gra­tion”

adobeio-campaign-techonol4

Here you have to do 3 things:

  • Give the Title and description for the integration.
  • Provide the pub­lic-key (certificate.pem)
  • Select the license

Important:

  • Be careful while selecting the “License”.This is very critical. If not done correctly, you will not be able to make the call due to incorrect license.
  • If you use putty, you need to convert the key into pem format.

Step 3: Generating your access-token

Now that you have cre­at­ed your inte­gra­tion, you need to gen­er­ate your access-token. We will use Post­Man to gen­er­ate this.

We have to look at the below 3 steps:

  • You create the JWT token using your private key. This token is valid for a certain period.
  • Use this JWT token to create the “Bearer Token”
  • Use this bearer token to make multiple REST call.

Go to the JWT-tab in your inte­gra­tion:

adobeio-campaign-techonol5

 

In the sec­tion “Paste Pri­vate Key”, you need to spec­i­fy the full con­tents of secret.pem (including start and end tags).

Then press the but­ton “Gen­er­ate JWT”

adobeio-campaign-techonol6

Now you can use “Sam­ple CURL command” to gen­er­ate the access-token.

Copy this, and open Post­Man

 

adobeio-campaign-techonol7

  • Choose to “Import” the curl com­mand to cre­ate the request in Post­Man.
  • After the import, you can exe­cute the request to gen­er­ate the access-token.

adobeio-campaign-techonol8

  • The val­ue of access_token will be used fur­ther on in the blog­post

Step 4: Execute the API-call

  • Now that we have the access-token, we can exe­cute an API call
  • For this, I will use this end­point to receive all pro­files from Adobe Cam­paign Standard: https://mc.adobe.io/acs054.msavlab.adobe.com/campaign/profileAndServices/profile/

adobeio-campaign-techonol9

 

error: Content is protected !!