Adobe IO - Fetch post call and return response back from external endpoint | Community
Skip to main content
El-Coder
Level 2
March 30, 2022
Solved

Adobe IO - Fetch post call and return response back from external endpoint

  • March 30, 2022
  • 1 reply
  • 2073 views

In adobe IO action I need to fetch data from an external endpoint and return the response back to campaign standard,

I need help on this one,

Thank you !

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by DanielHi7

have you tried

params['__ow_headers']

1 reply

Adobe Employee
March 31, 2022

Hi El-Coder,

 

What do you need help with?

 

  1. Are you unable to create an IO action / endpoint?
  2. Are you unable to connect to the external endpoint?
  3. Are you unable to sent data to Adobe Campaign?

I need more information to be able to help you.

 

Regards,

El-Coder
El-CoderAuthor
Level 2
March 31, 2022

Hi,

Yes all is in place ,

I’m asking if there’s any way to get the headers data from the system that’s calling the action I’ve created.

I succeeded retrieving the payload data but still struggling to get headers data 😓

thank you for your help.

 

El-Coder
El-CoderAuthor
Level 2
April 15, 2022

Correct

async function functionName(payload) <-- here you are just renaming `params` to `payload`. The contents are still the same, payload and headers.

 

If you debug params what attributes do you see? I think you can just filter out anything that starts with `__ow_`

Something like this:

/**
 *
 * Returns the parameters without `__ow` attributes.
 *
 * @param {object} params action input parameters.
 *
 * @returns {object}
 *
 */
function getStrippedParams(params) {
  let cleanedParams = {}

  for (const attr in params) {
    if (!attr.startsWith('__ow'))
      cleanedParams[attr] = params[attr]
  }

  return cleanedParams
}

 


Hello dhindle, this is brilliant 🌟
Thank you very much for your help !