After reviewing the post https://experienceleaguecommunities.adobe.com/t5/adobe-analytics-questions/how-to-integrate-salesforce-with-adobe-analytics/m-p/278675 I got some insights to write some custom code as below.
Add this code through adobe launch as a custom code.
const authTokenUrl = "{{end point url}}/services/oauth2/token?grant_type=password&client_id={{Pass the client id here}}.&client_secret={{Pass the client secret here}}&username={{Pass the API username here}}&password={{Pass the API username password}}";
const apiUrl = "{{sandbox url}}/services/data/v50.0/query?q=SELECT Id,Lead_Email,Status, Description FROM Case WHERE Lead_Email='{{Pass the logged in user name here}}'";
// Step 1: Get the Auth Token (GET request)
fetch(`${authTokenUrl}`, {
method: "POST",
})
.then(response => {
return response.json()
}).then(authResp => {
let access_token = authResp.access_token;
fetch(apiUrl,{
method: "GET",
headers: {
"Authorization" : "Bearer "+access_token }
}).then(response1 => {
return response1.json()
}).then(result => {
console.log(result);})})