The login process consists of two steps: obtaining a token, and then exchanging credentials (username and password).
You can find your access key under "My Preferences" in the Kafinea web interface.
Step 1: Obtain a token (getchallenge) #
GET
https://apps.kafinea.com/{instance}/webservice.php
| Setting | Type | Required | Description |
|---|---|---|---|
operation |
string | yes | Must be getchallenge |
username |
string | yes | Username: Kafinea |
Curl example:
curl "https://apps.kafinea.com/YourKafinea/webservice.php?operation=getchallenge&username=admin"
Answer:
{
"success": true,
"result": {
"token": "[TOKENSTRING]",
"serverTime": "[TIMESTAMP]",
"expireTime": "[TIMESTAMP]"
}
}
Step 2: Log in #
POST
https://apps.kafinea.com/{instance}/webservice.php
| Setting | Type | Required | Description |
|---|---|---|---|
operation |
string | yes | Must be login |
username |
string | yes | Username: Kafinea |
accessKey |
string | yes | md5(token + accessKey) — Note: the K is capitalized |
Curl example:
curl -X POST https://apps.kafinea.com/YourKafinea/webservice.php \
-d "operation=login" \
-d "username=admin" \
-d "accessKey=YOUR_MD5_HASH"
Answer:
{
"success": true,
"result": {
"sessionId": "[STRING]",
"userId": "[STRING]",
"version": "[STRING]",
"kafineaVersion": "[STRING]"
}
}
Logout #
POST
https://apps.kafinea.com/{instance}/webservice.php
| Setting | Type | Required | Description |
|---|---|---|---|
operation |
string | yes | Must be logout |
sessionName |
string | yes | Session ID obtained upon login |
Curl example:
curl -X POST https://apps.kafinea.com/YourKafinea/webservice.php \
-d "operation=logout" \
-d "sessionName=YOUR_SESSION_ID"
Extend the session (extendsession) #
If you need to extend the duration of your session, use this option.
GET
https://apps.kafinea.com/{instance}/webservice.php
| Setting | Type | Required | Description |
|---|---|---|---|
operation |
string | yes | Must be extendsession |
Curl example:
curl "https://apps.kafinea.com/YourKafinea/webservice.php?operation=extendsession"