Docs‎ > ‎Logic Designer‎ > ‎Security‎ > ‎Authentication‎ > ‎

Using the command line

In some cases, you may need to retrieve an API key from the command line. This can easily be done using curl.

First, ask the Espresso server what type of authentication information is required (you can of course skip this if you know that a certain authentication provider is in use):


You'll need to substitute the proper URL to your project.

The response should be something like:

  "links": [
  "fields": [
      "name": "username",
      "display": "Username",
      "description": "Enter your username",
      "helpURL": null,
      "type": "text",
      "length": 30
      "name": "password",
      "display": "Password",
      "description": "Enter your password",
      "helpURL": null,
      "type": "password",
      "length": 30

You then submit values for the parameters described in that last response:

curl -H "Content-type: application/json" --data-binary "{\"username\": \"jdoe\", \"password\": \"secret\"}" 

Once again, you'll need to substitute proper values for the URL, the username and the password.
The response should look like:

  "apikey": "ff908cee433929b06ad8ecc122ff8fa1",
  "expiration": "2014-07-22T12:00:42.398Z",
  "lastLoginTs": "2014-07-21T02:00:04.000Z",
  "lastLoginIP": "",
  "email": ""

The apikey is the critical piece of information. You will typically use it in an HTTP header named Authorization (an unfortunate name, but that's the convention), in the format:

Authorization: Espresso ff908cee433929b06ad8ecc122ff8fa1:1

Note the :1 added at the end of the API key -- it is required.