Posts

Showing posts with the label Javascript in postman

How To Automate Rest API in Postman

Image
How To Automate Rest API  in Postman  1.  Let us take an example in which we need to create shipment  Step 1 : login via username /password and then getting the access token in response . [ Login API ] Step 2 : Creating the shipment each time with unique AWB no . [ automating AWB no in request ] and passing the access token in header generated via Step 1.   login API POST Request http://XXX/oauth/token?grant_type=password&client_id=my-trusted-client&username=user1&password=pass1 Header Content-Type : Application/json Response {   "access_token": "eyJhbGciOiJIUzI1NiJ9.eyJleHBpcmF0aW9uIjoxNDc3MzE1NjMyMjc1LCJpc3N1ZWRBdCI6MTQ3NzMwNTYzMjI3NSwiaXNzdWVyIjoiT2xwQXV0aCIsInR5cGUiOiJhY2Nlc3NfdG9rZW4iLCJpc3N1ZWRGb3IiOiJha3NoYXkuYWdhcndhbEB1bmljb21tZXJjZS5jb20iLCJvdGhlckNsYWltcyI6e319.EmWoYEOXRjlloZlfM9ggHftxmnlowzPxFI9gPOAOnBk",   "token_type": "bearer",   "refresh_token": "eyJhbGciOiJIUzI1NiJ9.eyJleHBpc...