Skip to content
Snippets Groups Projects
api-examples.sh 856 B
Newer Older

# Admin IP/port
ip=127.0.0.1:8000

# Public IP/port
pip=127.0.0.1:8080

echo "Check if admin port can be reached:"

curl http://$ip/health/ready

echo "List identities:"

curl http://$ip/identities

echo "Get schema:"

curl http://$pip/schemas/default

echo "Create ID:"

json='{
"schema_id": "default",
"traits": {
        "email": "test@greenhost.nl",
        "name": {
                "first": "Dave",
                "last": "Stanley"
                }
        }
}'


curl -d "$json" -X POST http://$ip/identities


echo "Update an id"
id=af9b4abc-6308-48e2-abda-04e664487cf9

json='{
"schema_id": "default",
"traits": {
        "email": "test@greenhost.nl",
        "name": {
                "first": "Dave",
                "last": "Stanley"
                },
        "totp": "12345"
        }
}
'

curl -d "$json" -X PUT http://$ip/identities/$id