- API-Referenz
- Benutzer
- Get profile information for a user
Get profile information for a user
Request
- userIdstringrequired
selfor the id of a user.
Responses
The user profile.
- avatarRefstring (uuid)
- customerMembershipsobject
- *object
- expiresAtstring (date-time)
- idstring (uuid)required
- memberSincestring (date-time)required
- rolestring (einer von: owner, member, accountant)required
- emailstring (email)
- employeeInformationobject
Additional information about mittwald employees.
- departmentstringrequired
- isEmployeeboolean
Truth value, whether the user is a mittwald employee
- mfaobject
- activebooleanrequired
- setupbooleanrequired
- passwordUpdatedAtstring (date-time)
- personobjectrequired
The users personal information, e.g. first name.
- firstNamestringrequired
The users first name
- lastNamestringrequired
The users last name
- titlestring (einer von: mr, ms, other)
- phoneNumberstring
- projectMembershipsobject
- *object
- expiresAtstring (date-time)
- idstring (uuid)
- inheritedbooleanrequired
- memberSincestring (date-time)required
- rolestring (einer von: owner, emailadmin, external, id)required
- registeredAtstring (date-time)
- userIdstring (uuid)required
Content-Type: application/json
{
"avatarRef": "f0f86186-0a5a-45b2-aa33-502777496347",
"customerMemberships": {
"string": {
"expiresAt": "1985-10-26T01:21:00.000Z",
"id": "f0f86186-0a5a-45b2-aa33-502777496347",
"memberSince": "1985-10-26T01:21:00.000Z",
"role": "owner"
}
},
"email": "email@mittwald.example",
"employeeInformation": {
"department": "Kundenservice"
},
"isEmployee": true,
"mfa": {
"active": true,
"setup": true
},
"passwordUpdatedAt": "1985-10-26T01:21:00.000Z",
"person": {
"firstName": "Ada",
"lastName": "Lovelace",
"title": "mr"
},
"phoneNumber": "+491701234567",
"projectMemberships": {
"string": {
"expiresAt": "1985-10-26T01:21:00.000Z",
"id": "f0f86186-0a5a-45b2-aa33-502777496347",
"inherited": true,
"memberSince": "1985-10-26T01:21:00.000Z",
"role": "owner"
}
},
"registeredAt": "1985-10-26T01:21:00.000Z",
"userId": "f0f86186-0a5a-45b2-aa33-502777496347"
}
{
"properties": {
"avatarRef": {
"format": "uuid",
"type": "string"
},
"customerMemberships": {
"additionalProperties": {
"properties": {
"expiresAt": {
"format": "date-time",
"type": "string"
},
"id": {
"format": "uuid",
"type": "string"
},
"memberSince": {
"format": "date-time",
"type": "string"
},
"role": {
"enum": [
"owner",
"member",
"accountant"
],
"type": "string"
}
},
"required": [
"role",
"memberSince",
"id"
],
"type": "object"
},
"type": "object"
},
"email": {
"format": "email",
"type": "string"
},
"employeeInformation": {
"description": "Additional information about mittwald employees.",
"properties": {
"department": {
"example": "Kundenservice",
"type": "string"
}
},
"required": [
"department"
],
"type": "object"
},
"isEmployee": {
"description": "Truth value, whether the user is a mittwald employee",
"type": "boolean"
},
"mfa": {
"properties": {
"active": {
"default": false,
"type": "boolean"
},
"setup": {
"default": false,
"type": "boolean"
}
},
"required": [
"active",
"setup"
],
"type": "object"
},
"passwordUpdatedAt": {
"format": "date-time",
"type": "string"
},
"person": {
"type": "object",
"description": "The users personal information, e.g. first name.",
"properties": {
"firstName": {
"type": "string",
"description": "The users first name",
"example": "Ada"
},
"lastName": {
"type": "string",
"description": "The users last name",
"example": "Lovelace"
},
"title": {
"type": "string",
"enum": [
"mr",
"ms",
"other"
]
}
},
"required": [
"lastName",
"firstName"
]
},
"phoneNumber": {
"example": "+491701234567",
"type": "string"
},
"projectMemberships": {
"additionalProperties": {
"properties": {
"expiresAt": {
"format": "date-time",
"type": "string"
},
"id": {
"format": "uuid",
"type": "string"
},
"inherited": {
"type": "boolean"
},
"memberSince": {
"format": "date-time",
"type": "string"
},
"role": {
"enum": [
"owner",
"emailadmin",
"external",
"id"
],
"type": "string"
}
},
"required": [
"role",
"memberSince",
"inherited"
],
"type": "object"
},
"type": "object"
},
"registeredAt": {
"format": "date-time",
"type": "string"
},
"userId": {
"format": "uuid",
"type": "string"
}
},
"required": [
"userId",
"person"
],
"type": "object"
}
Validation Error caused by invalid input data in the request
- type"ValidationError"required
- messagestring
- validationErrorsArray von objectrequired
- Array[
- *object
- messagestringrequired
The standard error message
- pathstringrequired
The path to the part of the data that was validated. JavaScript property access notation (e.g., ".prop[1].subProp") is used.
- typestringrequired
ajv validation error type (e.g. "format", "required", "type") or own validation error types
- contextobject
The object with the additional information about the error that can be used to create custom error messages. Keys depend on the type that failed validation (e.g. "missingProperty" for type "required")
- *string
]
Content-Type: application/json
{
"type": "ValidationError",
"message": "Validation failed",
"validationErrors": [
{
"message": "should be string",
"path": ".address.street",
"type": "format",
"context": {
"format": "email"
}
}
]
}
{
"type": "object",
"required": [
"type",
"validationErrors"
],
"properties": {
"type": {
"type": "string",
"enum": [
"ValidationError"
]
},
"message": {
"type": "string",
"example": "Validation failed"
},
"validationErrors": {
"type": "array",
"items": {
"type": "object",
"required": [
"message",
"path",
"type"
],
"properties": {
"message": {
"type": "string",
"description": "The standard error message",
"example": "should be string"
},
"path": {
"type": "string",
"description": "The path to the part of the data that was validated. JavaScript property access notation (e.g., \".prop[1].subProp\") is used.\n",
"example": ".address.street"
},
"type": {
"type": "string",
"description": "ajv validation error type (e.g. \"format\", \"required\", \"type\") or own validation error types",
"example": "format"
},
"context": {
"type": "object",
"example": {
"format": "email"
},
"description": "The object with the additional information about the error that can be used to create custom error messages. Keys depend on the\ntype that failed validation (e.g. \"missingProperty\" for type \"required\")\n",
"additionalProperties": {
"type": "string"
}
}
}
}
}
}
}
An unexpected Error that occurred while handling the request
- messagestringrequired
- typestringrequired
Content-Type: application/json
{
"message": "Something went wrong",
"type": "InternalServerError"
}
{
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"message": {
"type": "string",
"example": "Something went wrong"
},
"type": {
"type": "string",
"example": "InternalServerError"
}
}
}
An unexpected Error that occurred while handling the request
- messagestringrequired
- typestringrequired
Content-Type: application/json
{
"message": "Something went wrong",
"type": "InternalServerError"
}
{
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"message": {
"type": "string",
"example": "Something went wrong"
},
"type": {
"type": "string",
"example": "InternalServerError"
}
}
}
An unexpected Error that occurred while handling the request
- messagestringrequired
- typestringrequired
Content-Type: application/json
{
"message": "Something went wrong",
"type": "InternalServerError"
}
{
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"message": {
"type": "string",
"example": "Something went wrong"
},
"type": {
"type": "string",
"example": "InternalServerError"
}
}
}
An unexpected Error that occurred while handling the request
- messagestringrequired
- typestringrequired
Content-Type: application/json
{
"message": "Something went wrong",
"type": "InternalServerError"
}
{
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"message": {
"type": "string",
"example": "Something went wrong"
},
"type": {
"type": "string",
"example": "InternalServerError"
}
}
}
An unexpected Error that occurred while handling the request
- messagestringrequired
- typestringrequired
Content-Type: application/json
{
"message": "Something went wrong",
"type": "InternalServerError"
}
{
"type": "object",
"required": [
"type",
"message"
],
"properties": {
"message": {
"type": "string",
"example": "Something went wrong"
},
"type": {
"type": "string",
"example": "InternalServerError"
}
}
}
Nutzungsbeispiele
$ curl \
--fail \
--location \
-H "Authorization: Bearer $MITTWALD_API_TOKEN" \
https://api.mittwald.de/v2/users/string
import { MittwaldAPIV2Client } from "@mittwald/api-client";
import { assertStatus } from "@mittwald/api-client-commons";
const client = MittwaldAPIClient.newWithToken(process.env.MITTWALD_API_TOKEN);
const response = await client.user.getUser({
"userId": "string"
});
assertStatus(response, 200);
use \Mittwald\ApiClient\Generated\V2\Clients\User\GetUser\GetUserRequest;
$client = MittwaldAPIClient::newWithToken(getenv('MITTWALD_API_TOKEN'));
$request = (new GetUserRequest(
userId: "string"
));
$response = $client->user()->getUser($request);
var_dump($response->getBody();