on 2023 Apr 08 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
Request clarification before answering.
Hi,
I'm facing the same issue. Did you find a solution to this problem?
Kind regards,
Jonatan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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 |
---|---|
42 | |
6 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.