TimeZone in REST API
Status: Reported
Description
When using DatabaseTableAgent to set consent (and possibly other things), the timezone specified in the object is ignored (?).
Steps to reproduce:
Request1:
POST {{webapi_url}}v1/Agents/DatabaseTable/Upsert
body:
{
"Tablename": "consentperson",
"Columns": [
"person_id",
"consentPurpose_id",
"legalBase_id",
"consentSource_id",
"updated",
"registered"
],
"Keys": [
"person_id",
"consentPurpose_id"
],
"Data": [
[
1,
"2",
7,
7,
"2023-10-24T14:40:40Z",
"2023-10-24T14:38:40Z"
]
]
}
Notice that the update and registered date is specified to Zulu time, which is the military designation for UTC.
Request2:
POST {{webapi_url}}v1/Agents/Person/GetConsentInfos
Header: SO-TimeZone: UTC, includeTZOffset
body:
{ "PersonId": "1"}
Response:
{
"ConsentPersonId": 24,
"Comment": "",
"Registered": "2023-10-24T16:38:40Z",
"RegisteredAssociateId": 18,
"Updated": "2023-10-24T16:40:40Z",
"UpdatedAssociateId": 0,
"LegalBaseId": 7,
"LegalBaseKey": "WITHDRAWN",
"LegalBaseName": "NO:\"Trukket tilbake\";IT:\"Ritirato\";PL:\"Wycofana\";JP:\" \";CN:\" \";FR:\"Annul \";CZ:\"Zruaeno\";SP:\"Retirado\";SW:\" terkallat\";NL:\"Ingetrokken\";DA:\"Trukket tilbage\";FI:\"Poistettu\";GE:\"Widerrufen\";US:\"Withdrawn\";RU:\"B>720=>\"",
"ConsentPurposeId": 2,
"ConsentPurposeKey": "EMARKETING",
"ConsentPurposeName": "US:\"E-marketing\";GE:\"E-Marketing\"",
"ConsentSourceId": 7,
"ConsentSourceKey": "IMPORT",
"ConsentSourceName": "NO:\"Import\";IT:\"Importazione\";PL:\"Import\";JP:\"r p \";CN:\" e\";FR:\"Importation\";CZ:\"Import\";SP:\"Importaci n\";SW:\"Import\";NL:\"Import\";DA:\"Import\";FI:\"Tuonti\";GE:\"Import\";US:\"Import\";RU:\"@B\"",
"TableRight": null,
"FieldProperties": {}
}
Based on testing it looks like the initial POST ignores the timezone specified in the body, and it converts it 'to base timezone' before archive. Inside SuperOffice the updated-date looks to be way off:
There is no Timezone configured on this tenant, and that might be the root issue, but it is also not possible to actually activate timezone as the dropdown is empty:
Details
Issue id | 48726 |
Registered | 31 Oct 2023 |
Last modified | 17 Nov 2023 |
Severity | Medium |
Area | Sales |
Status | Reported |
Target release | |
Type | Bug |
Comments