Hi All,
I'm trying to generate an access token programmatically and followed the steps per the documentation here: https://experienceleague.adobe.com/docs/experience-platform/tags/api/getting-started.html?lang=en#:~...
But I'm getting a 503: Service Unavailable response!
Is it not available anymore, or I'm missing something?
Thanks.
Solved! Go to Solution.
Topics help categorize Community content and increase your ability to discover relevant content.
Hi @Stewart_Schilling, thanks for your reply.
Fortunately, the problem has been resolved, and the root reason was sending 'Content-Type: multipart/form-data' in the payload when the data sent in the body was already in the correct format (format-data). But the problem now is that I want to generate JWT automatically, such as giving an expired token and getting a new token instead, but this method needs sending a valid token to receive another valid token! So it's not that useful to me; have you tried or implemented something similar before?
Also, I'm using vanilla JS in the client side (Google Apps Script) to fetch the data.
I have experience with this. Can you share the api call info that is yielding a 503? Maybe I can help you out? Also, if you are using nodeJS, I can share some code that I use for JWT creation and exchange.
Hi @Stewart_Schilling, thanks for your reply.
Fortunately, the problem has been resolved, and the root reason was sending 'Content-Type: multipart/form-data' in the payload when the data sent in the body was already in the correct format (format-data). But the problem now is that I want to generate JWT automatically, such as giving an expired token and getting a new token instead, but this method needs sending a valid token to receive another valid token! So it's not that useful to me; have you tried or implemented something similar before?
Also, I'm using vanilla JS in the client side (Google Apps Script) to fetch the data.
Here's my code to create the JWT and get a bearer token. You will probably need to change your metaScopes, but the rest should work as-is.
const auth = require("@adobe/jwt-auth");
async function getToken() {
let buff = Buffer.from(process.env.ADOBE_IO_PRIVATE_KEY, 'base64');
let adobe_io_private_key = buff.toString('ascii');
const credentials = {
clientId: `${process.env.ADOBE_IO_CLIENT_ID}`,
technicalAccountId: `${process.env.ADOBE_IO_TECH_ACCOUNT_ID}`,
orgId: `${process.env.ADOBE_IO_ORG_ID}`,
clientSecret: `${process.env.ADOBE_IO_CLIENT_SECRET}`,
metaScopes: "https://ims-na1.adobelogin.com/s/ent_reactor_sdk",
privateKey: `${adobe_io_private_key}`
}
return await auth(credentials);
}
Thank you so much for your help
Views
Replies
Total Likes
Views
Like
Replies