title: How do I pass the email in alias header and obtain specific responses?
body: <p>*New to Rest Assured </p>
  
  <p><strong>Question:</strong>
  <br>
  How do I pass the email (<em>User email</em> required for GET endpoint) in the alias header and obtain the session ID as well as the username ID from the response?</p>
  
  <p><strong>Details</strong>:
  The [GET] users/signin endpoint requires a user email and an api key.</p>
  
  <p><strong>Curl:</strong>
  <p></p>
  
  <pre><code>curl -X GET "https://SomeWebSite.com/apiservice/users/signin?challengeMethod=EMAIL" -H "accept: application/json" -H "alias: usersignin@EXAMPLE.com" -H "X-API-KEY: d5a1d56d51d651d651d51d651d6d6d1"
  </code></pre>
  
  <p><strong>Response:</strong>
  <br></p>
  
  <pre><code>{
  "session": "ID inside of here",
  "challengename": "CUSTOM_CHALLENGE",
  "challengeSentTo": "usersignin@EXAMPLE.com",
  "username": "5d654d6d65dd64d66adsb6a4"
  }
  </code></pre>
  
  <p><p></p>
  
  <p><strong>My code:</strong>
  <p></p>
  
  <pre><code>public class AuthResponseTest {
  
      public static final String baseUri = "https://qa-mobile-app-auth-ext.clearcollateral.com/";
      public static final String basePath = "/apiservice/users ";
  
  public String[] getSignIn() {
  
         return RestAssured
                  .with()
                  .log().all()
                  .header("X-API-KEY", "API KEY IN HERE")
                 .header("alias", "email here")
                  .contentType(ContentType.JSON)
                  .accept(ContentType.JSON)
                  .baseUri(baseUri)
                  .basePath(basePath)
                 .when()
                 .post("/users/signin")
                 .then()
                 .log().all()
                 .statusCode(200)
         .extract().as(String[].class);
      }
      @Test
      public void testSignIn() {
          String[] authsignin =  getSignIn();
          System.out.println(authsignin);
      }
  }
  </code></pre>