Skip to content

Accounts

Accounts API for basic account management.

Get account information

my account

HTTP
curl {{host}}/api/core/account/profile \
-H "Authorization: Token {{token}}" \
Response
JSON
{
  "success": true,
  "message": "",
  "requestID": "",
  "executed_at": "2050-01-01T00:00:00.123456Z",
  "data": {
    "instance": {
      "kv.v.api.version": "0000",
      "kv.v.api.url": "http://app.platformaerp.com",
      "kv.v.owner.name": "paanda"
    },
    "user": {
      "username": "[email protected]",
      "emailconfirmed": false,
      "phonenumber": "123231435311",
      "team_id": "84a43f6b-7e3c-b7cd-a68b-48da22024540",
      "team_name": "edokumenty-90-zarzad",
      "user_app_name": "erp",
      "user_first_name": "test",
      "user_last_name": "test1",
      "user_home": null,
      "user_color": "#FD9BBF",
      "user_short": "TT",
      "user_currency": "EUR",
      "user_properties": {
        "root": {
          "test": "value",
          "test2": "value"
        }
      }
    },
    "teams": [
      {
        "team_id": "75d2c7f1-5e35-c366-b686-48da3c3cb2f0",
        "team_short": "90Z",
        "team_name": "edokumenty-90-ZARZAD-1",
        "teamuser_lvl": null,
        "team_type": "internal"
      },
      {
        "team_id": "d58de8a6-4173-e311-b9e9-001a64689f03",
        "team_short": "COM",
        "team_name": "Common",
        "teamuser_lvl": null,
        "team_type": "internal"
      }
    ],
    "apps": [
      "app-client",
      "cenniki"
    ],
    "roles": [
      "app_administrator",
      "app_app-client"
    ]
  }
}

selected account

sys_administrator

HTTP
curl {{host}}/api/core/account/profile/{{username}} \
-H "Authorization: Token {{token}}" 
  • username - optional, if not provided, the current user account is returned

Account list

sys_administrator

HTTP
curl {{host}}/api/core/account/browse \
-H "Authorization: Token {{token}}" 
Response
JSON
{
  "success": true,
  "message": "Account List",
  "requestID": "",
  "executed_at": "2050-01-01T00:00:00.123456Z",
  "data": {
    "items": [
      {
        "id": "A83D6E10-03C0-4687-BB3F-7AF9DE04427D",
        "username": "[email protected]",
        "phonenumber": "123231435311",
        "emailconfirmed": false,
        "lockoutenabled": true,
        "islocked": false,
        "isactive": true,
        "lockoutend": "2024-08-04T21:12:12.713039+00:00",
        "lockoutending": "2024-08-04T21:12:12.713039Z",
        "lastActivity": "2050-01-01T00:00:00.123",
        "team_id": "84a43f6b-7e3c-b7cd-a68b-48da22024540",
        "team_name": "edokumenty-90-zarzad",
        "user_currency": "EUR",
        "user_home": null,
        "user_app_name": "erp",
        "teams": 6,
        "roles": 65,
        "user_first_name": "test",
        "user_last_name": "test1",
        "user_color": "#FD9BBF",
        "user_avatar": null,
        "user_short": "TT"
      },
      {
        "id": "ff9f04dc-a7db-4948-9475-9a848e764f01",
        "username": "[email protected]",
        "phonenumber": "+48603099113",
        "emailconfirmed": false,
        "lockoutenabled": true,
        "islocked": false,
        "isactive": true,
        "lockoutend": null,
        "lockoutending": null,
        "lastActivity": "2050-01-01T00:00:00.123",
        "team_id": "d58de8a6-4173-e311-b9e9-001a64689f03",
        "team_name": "Common",
        "user_currency": "pln",
        "user_home": null,
        "user_app_name": "erp",
        "teams": 5,
        "roles": 69,
        "user_first_name": "TEst",
        "user_last_name": "test1",
        "user_color": "#B2E79D",
        "user_avatar": null,
        "user_short": "TT"
      }
    ],
    "stats": {
      "count": 19,
      "locked": 0,
      "last_week": 3,
      "today": 2
    }
  }
}

Copy account roles and teams

sys_administrator

HTTP
POST {{host}}/api/core/account/copy/{{source_username}}/{{target_username}}
Authorization: Token {{token}}

Lock/unlock account

sys_administrator

HTTP
POST {{host}}/api/core/account/lock/{{username}}
Authorization: Token {{token}}

sys_administrator

HTTP
POST {{host}}/api/core/account/unlock/{{username}}
Authorization: Token {{token}}

Cancel account

sys_administrator

HTTP
POST {{host}}/api/core/account/cancel/{{username}}
Authorization: Token {{token}}

Business objects:

  • [app].[user_cancel] - Triggered when api cancel account is called, additional logic can be added

Update account

HTTP
1
2
3
curl -X POST {{host}}/api/core/account/profile-update/{{username}} \
-H "Authorization: Token {{token}}"
-d "{'PhoneNumber':'+48603099116', 'key2':'value2'}"
  • username - optional, if not provided, the current user account is returned

Query parameters:

  • user_currency
  • phoneNumber
  • team_id
  • user_first_name
  • user_last_name
  • user_color - color in hex format
  • user_avatar - url to avatar
  • user_short

Set Context

Set application context for the user.

HTTP
curl -X POST {{host}}/api/core/account/context/{{app_name}}/{{username}} \
-H "Authorization: Token {{token}}"
  • username - optional, if not provided, the current user account is returned