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.