Users

Use the following methods to create, deactivate, activate and update users belonging to a company.

To use these methods you must add the X-eSignatur-Id header containing your API key and the X-eSignatur-CreatorId header containing the identifcation of a user with administrative privileges.

The following model is used in the request to the Add and Update methods:

UserModel
Name Type Description Optional
UserId String User Id.
NewUserId String New e-Id of user (in case of e-Id change).
Name String Name of user.
Emails String[] List of email-addresses associated with this user.
IsCustomerAdmin Boolean Do the user have administrative privileges? yes
UserIdentificationType String eID used to access the Portal - defaults to NemID. yes


The following model is used in the response from the Index and Get methods:

UserResponseModel
Name Type Description Optional
UserId String Id of user (the users e-Id or Employee number.
Name String Name of user.
Emails String[] List of email-addresses associated with this user.
IsCustomerAdmin Boolean Flag indicating if this user have administrative privileges.
IsDeleted Boolean Flag indicating if this user is soft-deleted (deactivated).


The following models is used in the response from the Add, Update, Deactivate and Activate methods:

UserChangeResponseModel
Name Type Description Optional
UserId String User Id.
Status String Did the requested action succeed? (OK or ERROR).
Message String A descriptive message following this request.



Get list of current users

Description

Gets a list of users belonging to this company.

Synopsis

GET api.esignatur.dk/User/Index

JSON Output

[
  {
    "UserId": "1234",
    "Name": "User Usersen",
    "Emails": [
      "user1@local"
    ],
    "IsCustomerAdmin": false,
    "IsDeleted": false
  },
  {
    "UserId": "4321",
    "Name": "Usain User",
    "Emails": [
      "user2@local"
    ],
    "IsCustomerAdmin": true,
    "IsDeleted": false
  }
]


Get user by UserId

Description

Get the attributes of the user by UserId.

Synopsis

GET api.esignatur.dk/User/Get/{user-id}

JSON Output

{
  "UserId": "1234",
  "Name": "User Usersen",
  "Emails": [
    "user1@local"
  ],
  "IsCustomerAdmin": false,
  "IsDeleted": false
}


Add new user

Description

Add a new user to the system. If a user with the given UserId exists this method will fail.

Synopsis

POST api.esignatur.dk/User/Add

JSON Input

[
  {
    "UserId": "54321",
    "Name": "Parrot and Ferrets",
    "Emails": [
      "parrot@ferret.local"
    ],
    "IsCustomerAdmin": true
  }
]

JSON Output

[
  {
    "UserId": "54321",
    "Status": "OK",
    "Message": "Created"
  }
]


Update (modify) user

Description

Modifies a user. If a NewUserId is given and that id already exists this method will fail. Do not specify NewUserId if you only want to update, say, the name of the user. You can selectively specifiy one or more attributes to change.

Synopsis

POST api.esignatur.dk/User/Update

JSON Input

[
  {
    "UserId": "54321",
    "NewUserId": "15243",
    "Name": "Ferrets and Parrots"
  }
]

JSON Output

[
  {
    "UserId": "54321",
    "Status": "OK",
    "Message": "Changed UserId to 15243,Changed name"
  }
]


Deactivate user

Description

Deactivate one or more users to prevent them from creating orders.

Synopsis

POST api.esignatur.dk/User/Deactivate

JSON Input

[
  "15243"
]

JSON Output

{
  "UserId": "15243",
  "Status": "OK",
  "Message": "User deactivated"
}


Activate user

Description

Activate one or more users to enable them to create orders.

Synopsis

POST api.esignatur.dk/User/Activate

JSON Input

[
  "15243"
]

JSON Output

{
  "UserId": "15243",
  "Status": "OK",
  "Message": "User activated"
}