mahesht6923
mahesht6923

Reputation: 1

How to use one REST API RESPONSE property, and use it in another REST API header property

I would like to know how to property transfer from one REST API to another REST API?

I worked on the property transfer with the JSON format, but I need to know how to transfer the one REST API response property and use it in the header?

Upvotes: 0

Views: 1573

Answers (1)

snieguu
snieguu

Reputation: 2283

let me explain this using the below scenario:

  1. Admin get the User object by API
  2. Save apiKey from the user object
  3. Call the action on user behalf(By set Authorization Header to Basic with the user apiKey)

To accomplish these steps in soapUI You have to:

  1. Define apiKey in Custom Properties in TestCase
  2. Call resource that returns a User object
  3. Save apiKey property to TestCase.apiKey via property transfer or Groovy Step
  4. Reuse TestCase.apiKey in your nest REST Request step by expanding it via Basic ${=(testCase.getPropertyValue("apiKey")+":").bytes.encodeBase64()}

enter image description here

Hope that helps

Upvotes: 0

Related Questions