This API cookbook recipe describes how to create an authenticated session for using the Delphix Sever web services.

Before you can use any Delphix Web Service API’s you need to create a session, and then authenticate the session by providing valid Delphix account credentials.

Create Delphix API Session

$ curl -s -X POST -k --data @- http://delphix-server/resources/json/delphix/session \
    -c ~/cookies.txt -H "Content-Type: application/json" <<EOF
    "type": "APISession",
    "version": {
        "type": "APIVersion",
        "major": 1,
        "minor": 4,
        "micro": 3

Delphix Login

$ curl -s -X POST -k --data @- http://delphix-server/resources/json/delphix/login \
    -b ~/cookies.txt -c ~/cookies.txt -H "Content-Type: application/json" <<EOF
    "type": "LoginRequest",
    "username": "delphix_username",
    "password": "delphix_password"

NOTE: It is generally recommended to set the API session version to the highest level supported by your Delphix Engine.