title: Hashi vault - how to get x-vault-token to get secret id using role id?
body: <p>I am able to do the following using <code>CLI</code>.</p>
  <pre><code>// Get role id
  vault read auth/approle/role/irma-role/role-id
      Key     Value
      role_id b1e32157-8309-d5a2-02c9-657fc05977dc
  
  // Get secret id
  vault write -force auth/approle/role/irma-role/secret-id
      Key                Value                               
      secret_id          3cac8255-6f2d-e62f-fd0e-20bfe69a2dfe
      secret_id_accessor 8f811a56-d2c4-460c-8955-f2a18d8a2fdd
  
  // Login using role id and secret id
  vault write auth/approle/login role_id=&quot;b1e32157-8309-d5a2-02c9-657fc05977dc&quot; secret_id=&quot;ea34790f-f8c4-5527-3951-4e51b8b6e620&quot;
  </code></pre>
  <p>The above works great. But I need help in figuring out how to do using API. For example, how to I get the <code>X-Vault-Token</code> that the API is looking for while retrieving secret id?</p>
  <pre><code>$ curl \
      --header &quot;X-Vault-Token: ...&quot; \
      --request POST \
      http://127.0.0.1:8200/v1/auth/approle/role/application1/secret-id
  </code></pre>