Hi,
When updating chat group metadata I am facing the problem that, although my PUT operation succeeds, the old information is not replaced by the updated info.
This is what the metadata of the group is looking prior to the update:
{
"shipper":[
{
"uid":88,
"name":"John Miller",
"role":"shipper",
"companyCode":"SUPPLIER1234AT",
"companyName":"Supertrans"
}
],
"supplier":[
],
"groupType":"rfx"
}
I want to update some objects within the supplier node array. To do that, I read the existing metadata from the server and replace the supplier node with an updated one.
This is the data, that I send to the server:
{
"metadata":{
"shipper":[
{
"companyCode":"SUPPLIER1234AT",
"uid":88,
"role":"shipper",
"companyName":"Supertrans",
"name":"John Miller"
}
],
"groupType":"rfx",
"supplier":[
{
"companyCode":"Megatrans5432AT",
"uid":"89",
"role":"supplier",
"companyName":"Megatrans Ltd.",
"name":"Mike Sanders"
},
{
"companyCode":"Megatrans5432AT",
"uid":"64",
"role":"supplier",
"companyName":"Megatrans Ltd.",
"name":"Rob Howland"
},
{
"companyCode":"Megatrans5432AT",
"uid":"87",
"role":"supplier",
"companyName":"Megatrans Ltd.",
"name":"Carl Winston"
},
{
"companyCode":"Megatrans5432AT",
"uid":"89",
"role":"supplier",
"companyName":"Megatrans Ltd.",
"name":"Sam Snaker"
},
{
"companyCode":"Megatrans5432AT",
"uid":"64",
"role":"supplier",
"companyName":"Megatrans Ltd.",
"name":"Toni Malonie"
},
{
"companyCode":"Megatrans5432AT",
"uid":"87",
"role":"supplier",
"companyName":"Megatrans Ltd.",
"name":"Robbie Bubble"
}
]
},
"name":"myChatroom",
"guid":"54",
"type":"private"
}
I send it using Java Spring framework:
`
String response = restTemplate.exchange(URL + “/groups/{guid}” , HttpMethod.PUT, requestEntityMetadata, String.class, chatGroupId).getBody();
`
The response looks like this:
{
"data":{
"guid":"54",
"name":"myChatroom",
"type":"private",
"metadata":{
"shipper":[
{
"uid":88,
"name":"Thomas Gerstenmayer",
"role":"shipper",
"companyCode":"SUPPLIERE8866LU",
"companyName":"SHIPSTA S.\u00e0.r.l."
}
],
"supplier":[
],
"groupType":"rfx"
},
"membersCount":4,
"conversationId":"group_54",
"createdAt":1648134002,
"owner":"88",
"updatedAt":1648159949
}
}
That means that the updated data was not stored in the group. I’m out of ideas. Is there anyone who can help?