on 04-08-2023 12:18 PM
I am trying to download attachment via API and stuck as its only helping me with pdf downloads but when downloading other extensions like .csv or .docx or .xlsx the downloaded file is unable to decode the value and shows junk character
How to resolve this? I have tried using base64 decode that's not helpful also Arraybuffer too, below is the representation of my code and work.
Custom code
const parm = {
'realm': realm
};
const parmArray = Object.entries(parm).map(([key, value]) => `${key}=${encodeURIComponent(value)}`);
const joinedParm = parmArray.join('&');
const apiCallUrl = `https://openapi.ariba.com/api/procurement-reporting-attachments/v1/prod/attachment/${uniqueAttachmentId}?${joinedParm}`;
//irpa_core.log(apiCallUrl);
return {
method: 'GET',
url: apiCallUrl,
resolveBodyOnly: false,
rejectUnauthorized: false,
headers: {
Authorization: 'Bearer ' + access_token,
apiKey: apiKeyValue
}
};
chaitanyapriya.puvvada , prasanthpadmanabhan.menon , amiths.nair2 , thomas.jentsch
TIA
Hi Indrajit,
You can use the Download File activity to download the file irrespective of the file extension.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
78 | |
9 | |
8 | |
6 | |
6 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.