You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 60 Next »

API endpoints

US01 | Login user to AAS

GET

/user/login

Basic Authentification required

Remarks

  • This call delivers the JWT token (valid for 24h)

Status codes

  • 200 = Successful
  • 400 = Bad Request
  • 401 = User not authorized to login
  • 404 = User not found
  • 500 = Internal server error

Example call(s)

  • GET https://dev-ddb.fiz-karlsruhe.de/api/2/user/login


^ Back to top


US02 | Get info about logged-in user

GET

/user/info

User permission required

Response payload

Returns list of Privilege JSON objects:

{
    "id": "useradmin",
    "nickname": "useradmin",
    "status": "CONFIRMED",
    "title": "Dr.",
    "salutation": "Herr",
    "surName": "useradmin",
    "foreName": "useradmin",
    "telephoneNumber": "1",
    "faxNumber": "1",
    "email": "useradmin@admin.org",
    "created": "2017-03-24T17:59:13",
    "modified": "2020-09-29T06:29:02",
    "modifierId": "1eafbdc46c1ed32277fbcd24c33c01d8"
}

Status codes

  • 200 = Successful
  • 400 = Bad Request
  • 401 = User not authorized to login
  • 404 = User not found
  • 500 = Internal server error

Example call(s)

  • GET https://dev-ddb.fiz-karlsruhe.de/api/2/user/info


^ Back to top


US03 | Get all user privileges

GET

/user/privileges

User permission required

Response payload

Returns list of Privilege JSON objects:

[
    {
        "privilege": "READER_ORGS",
        "id": [],
        "global": true,
        "heritable": false
    },
    {
        "privilege": "FACHSTELLE_MUSEUM",
        "id": [],
        "global": true,
        "heritable": true,
        "sector": "Museum"
    }
]

Status codes

  • 200 = Successful
  • 400 = Bad Request
  • 401 = User not authorized to login
  • 403 = Authentication temporarily blocked
  • 404 = User not found
  • 423 = User is blacklisted
  • 428 = User has "unconfirmed" status
  • 500 = Internal server error

Example call(s)

  • GET https://dev-ddb.fiz-karlsruhe.de/api/2/user/privileges


^ Back to top


US04 | Get all organizations of user

GET

/user/organizations

User permission required

Response payload

Returns list of Privilege JSON objects:

{
    "treeResult": [
        {
            "treeResult": [
                {
                    "treeResult": [],
                    "organization": {
                        "id": "00000249",
                        "displayName": [
                            {
                                "value": "Archiv der Königlichen Porzellan-Manufaktur Berlin",
                                "lang": "deu"
                            }
                        ],
                        "type": "ddb-institution",
                        "administrativeNote": "# -- Daten aus der alten Registrierung:\",
                        "abbreviation": [],
...

Status codes

  • 200 = Successful
  • 304 = Attribute modified
  • 400 = Bad Request
  • 401 = User not authorized to login
  • 403 = Authentication temporarily blocked
  • 404 = User not found
  • 423 = User is blacklisted
  • 428 = User has "unconfirmed" status
  • 500 = Internal server error

Example call(s)

  • GET https://dev-ddb.fiz-karlsruhe.de/api/2/user/organizations


^ Back to top


US05 | Create new user

POST

/user

No Login (anonymous) required

Request payload

Returns User JSON object:

{
    "nickname": "testuser-ri",
    "email": "testuser-ri@ddb.de",
    "pswd": "testuser-ri"
}

Response payload

{
    "id": "cb5d9c5810e985e7beda092b22e1e480",
    "nickname": "testuser-ri",
    "status": "CONFIRMED",
    "surName": "surname is unknown",
    "email": "testuser-ri-1@ddb.de",
    "created": "2024-01-31T12:13:30",
    "creatorId": "anonymous",
    "modified": "2024-01-31T12:13:30",
    "modifierId": "anonymous"
}


Returns User JSON object:

{
    "id": "cb5d9c5810e985e7beda092b22e1e480",
    "nickname": "testuser-ri",
    "status": "CONFIRMED",
    "surName": "surname is unknown",
    "email": "testuser-ri-1@ddb.de",
    "created": "2024-01-31T12:13:30",
    "creatorId": "anonymous",
    "modified": "2024-01-31T12:13:30",
    "modifierId": "anonymous"
}

Status codes

  • 200 = Successful
  • 400 = Bad Request
  • 401 = User not authorized to login
  • 409 = Illegal State
  • 500 = Internal server error

Example call(s)

  • POST https://dev-ddb.fiz-karlsruhe.de/api/2/user


^ Back to top


US06 | Delete existing user

DELETE

/user/{id}

Admin permission required

Status codes

  • 204 = User successful deleted
  • 400 = Bad Request
  • 401 = User not authorized to login
  • 404 = User not found
  • 423 = User is blacklisted
  • 428 = User has "unconfirmed" status
  • 500 = Internal server error

Example call(s)

  • DELETE https://dev-ddb.fiz-karlsruhe.de/api/2/user/cb5d9c5810e985e7beda092b22e1e480


^ Back to top


  • No labels