postman auto store token

put script at pre-request tab

const jsonData = pm.response.json();

if (jsonData.token) {
pm.environment.set("token", jsonData.token); // or use pm.variables.set()
}

add token in enviroment variable. token will be push when success login

//

put {{token}} in authentication tab with bearer been selected.


Revision #1
Created 16 May 2025 03:38:28 by Editor
Updated 16 May 2025 03:40:31 by Editor