Version: 1.0.0 Workflow: authenticated-guild-query Category: Authentication
Authenticate by Cosmos signature, then query guild information.
webapp_address (a Cosmos address that is an approved member of the target guild)webapp_pubkey and the corresponding private key for signingwebapp_guild_id (the guild to log into, type 0 e.g. 0-1)webapp-auth-loginPOSThttp://localhost:8080/api/auth/loginSign the message LOGIN_GUILD{guild_id}ADDRESS{address}DATETIME{unix_timestamp} (timestamp within 600s of server time) and submit the signature.
Request Body:
{
"address": "",
"signature": "",
"pubkey": "",
"guild_id": "",
"unix_timestamp": ""
}
Request Headers:
| Header | Value |
|---|---|
| Content-Type | application/json |
Data Extraction:
session_cookie from response.headers.Set-Cookiesession_id from response.headers.Set-Cookie (extract PHPSESSID value)Expected Response:
200 — body { "success": true, "errors": {}, "data": null }schemas/responses.md#/definitions/AuthResponseError Handling:
| Status | Action |
|---|---|
| 401 | errors.signature_validation_failed (re-sign with fresh timestamp) or errors.player_address_does_not_exists (address not an approved member) |
| 500 | Server error - retry with exponential backoff |
webapp-guild-thisGEThttp://localhost:8080/api/guild/this
/api/guild/thisreturns the deployment’s host guild (guild_meta.this_infrastructure = TRUE), not the logged-in player’s guild. It is public. For the operator’s own guild, readsession.guild_id(set at login) or the player record.
Request Headers:
| Header | Value |
|---|---|
| Accept | application/json |
Data Extraction:
guild_id from response.body.data.idguild_name from response.body.data.nameExpected Response:
200schemas/entities.md#/definitions/Guild (inside data)Error Handling:
| Status | Action |
|---|---|
| 500 | Server error - retry with exponential backoff |
webapp-guild-member-countGEThttp://localhost:8080/api/guild//members/countRequest Headers (session required):
| Header | Value |
|---|---|
| Cookie | `` |
| Accept | application/json |
Data Extraction:
member_count from response.body.data.countExpected Response:
200schemas/responses.md#/definitions/CountResponse (inside data){
"guild": {
"id": "",
"name": "",
"member_count": ""
},
"session": {
"cookie": ""
}
}
| Step | Status | Action |
|---|---|---|
| 1 | 401 | Signature/timestamp invalid or address not an approved member - cannot proceed |
| 1 | 500 | Server error - retry with exponential backoff |
| 3 | 401 | Session expired - re-authenticate and retry |
This workflow demonstrates authentication followed by authenticated API calls. The session cookie from step 1 is used in subsequent requests.