Hi, I need to capture the value of a token from a text response. I am able to capture the whole response using “var responseText = pm.response.text();”. In that i need to capture the access_token value. Can someone please guide me as to how i can get the access_token value?
let str = pm.response.text(),
accessToken = str.split('&').find(param => param.startsWith('access_token')).split('=')[1];
console.log(accessToken);
There are a few other ways that you could do it and i’m sure others will respond on the topic telling you another way but if you wanted something quick, that should do.
Is that relevant to the topic here? Did you need that to provide a solution?
I don’t know what is and isn’t exactly part of those external libraries - Some of them are not the full library due to various reasons related to the sandbox environment.