API - Customer titles
Manage the customer titles
Routes
Method name | Route | Parameters | OK return code | Return |
---|---|---|---|---|
GET | /api/title | 200 | Results of the 'title' loop | |
GET | /api/title/{entityId} | entityId: The customer title id | 200 | Results of the 'title' loop for entityId |
POST | /api/title | 201 | Results of the 'title' loop for the created title | |
PUT | /api/title | 201 | Results of the 'title' loop for the updated title | |
DELETE | /api/title/{entityId} | entityId: The customer title id | 204 | Nothing |
Creation
If you want to create a title, you have to send the following fields with the POST method.
- i18n : a collection of the following fields:
- locale: The lang locale. Example: en_US
- short: The title short (optional). Example: Mr
- long: The title long (optional). Example: Mister
- default : if true, toggle the title to be the default one (optional)
Example
{
"default": 1,
"i18n": [
{
"locale": "en_US",
"short": "Mr",
"long": "Mister"
},
{
"locale": "fr_FR",
"short": "Mo",
"long": "Monsieur"
}
]
}
Update
To update a customer title, you have to send the same data ( only updated ones ) as for a create, but with the PUT method.
Moreover, you have to add the “title_id” field.
Example
{
"title_id": 42,
"i18n": [
{
"locale": "fr_FR",
"short": "M"
}
]
}