User address administration

Beschreibung:

TYRIOS makes it possible to manage user addresses directly from API. Here are general rules for using the user API:

  • TYRIOS depends on different module configurations. It depends on your configuration if an endpoint is available.
  • It depends on your rights if you can call a specific endpoint.
  • TYRIOS is an aspect oriented system. It depends on the concrete configuration, which fields are available and processes. In this document we will discuss the typical structure.

Authentication

The API endpoints of TYRIOS are only available for authorized users. Therefore, the user must be authenticated. There are two different authentication types:

  • Authentication by BASIC authentication. The user account must have an activated REST API token. You need to send an appropriate BASIC authentication header.
  • Authentication by mobile app registration. You need to send an appropriate app registration token.

Data structure

User addresses are realized as UserAddressData objects which are typically related to other objects like UserData objects

Due to the aspect-oriented nature of TYRIOS, it is very likely that your concrete data structure differs a bit of this general description. We recommend to request existing data objects to get the exact data structure.

API endpoints

UserAddressData cannot be accessed directly. They are always linked to another object and can only be accessed by this object.

API endpoints for UserData related addresses

The general endpoint for the user related address administration is

https://[instance.de]/service/UserAddressManagement/address/[userID]

It always requires an authenticated user.

List all user addresses

To list all addresses, you need to make a GET request to  following endpoint

https://[instance.de]/service/UserAddressManagement/address/[userID]

the data supports the following GET parameters

  • query: you can add a text query which is searched in name, preName, company, nickName or user id
  • limit: number of elements, defaults to 100

The response is an array of UserAddressData objects.

 

Create a user specific address

To create a user specific address, you need to send a PUT request to the following endpoint

 https://[instance.de]/service/UserAddressManagement/address/[userID]

 As payload, you need to send a UserAddressData object as JSON object.

  • the ID must be null
  • UserData object is automatically assigned and must be null in your payload
  • CustomerData object must be null

A minimal example to save the object is:

{
    "gender": "company", // type of address, possible values: male, female, company, club, city, organization, authority
    "name": "Mustermann", //last name of the contact address, required if company is not given
    "preName": "Max",
    "street": "Teststraße", //street name, required if no postOfficeBoxy is given
    "streetNo": "12",
    "postCode": "88605",
    "city": "Meßkirch",
    "country": "de", // country code in ISO 3166-1 Alpha-2 format
   
}

As response, you will get the fully saved address with ID.

Update a user specific address

To update a user specific address, you need to send a POST request to the following endpoint

 https://[instance.de]/service/UserAddressManagement/address/[userID]/[addressID]

 As payload, you need to send a UserAddressData object as JSON object. Please be aware that the concrete data fields depend on your installation and thus we recommend to first load the address, update the corresponding fields and send the data back.

The response is the updated UserAddressData object.

Delete a user specific address

To delete a user specific address, you need to send a DELETE request to the following endpoint

 https://[instance.de]/service/UserAddressManagement/address/[userID]/[addressID]

Vorgehen:

Tips und Tricks:

Abonnieren Sie unseren Newsletter

Bleiben Sie stets informiert. Wir informieren Sie gerne über Produktneuheiten und Angebote.