Hi,
if you say that your example works for you, how is Metadata/TsgcOpenAPI_AdditionalProperties unserialized?
I'm confused of the real code and your statement, I must oversee something.
Ok, but here is the Json:
{
"_id": "5b8cb290-0901-4435-9131-576695fab511",
"_type": "MANAGED_ORGANIZATION",
"_envs": [
"TEST"
],
"name": "Autogenerated-1",
"display_name": "Autogenerated-Kunde Nr. 1",
"address_line1": "Maingosse 1a",
"zip": "12345",
"town": "Berlin",
"country_code": "DEU",
"billing_options": {
"withhold_billing": true,
"bill_to_organization": "87fe7d03-7e90-4e5c-860f-21cc7e5bf436"
},
"metadata": {
"KdNr": "10001",
"AdGuid": "420739B4-3B2F-4DD1-BCB2-48997EEE930C"
},
"managed_by_organization_id": "87fe7d03-7e90-4e5c-860f-21cc7e5bf436",
"created_by_user": "d1e2fe75-6abe-4466-8690-3078b1c4285b"
}
The call was made from this (generated) code:
function TFiskalyManagementOpenApi.retrieveOrganization(aOrganization_id: string): TsgcOpenAPI_retrieveOrganization_Response;
begin;
result := TsgcOpenAPI_retrieveOrganization_Response.Create;
_retrieveOrganization(aOrganization_id, result);
if result.IsSuccessful then
result.Successful := TsgcOpenAPI_OrganizationResponse_Class.Read(result.ResponseText)
else
begin
case result.ResponseCode of
401: result.Error401 := TsgcOpenAPI_retrieveOrganization_ResponseError401_Class.Read(result.ResponseError);
403: result.Error403 := TsgcOpenAPI_retrieveOrganization_ResponseError403_Class.Read(result.ResponseError);
404: result.Error404 := TsgcOpenAPI_retrieveOrganization_ResponseError404_Class.Read(result.ResponseError);
end;
end;
end;
and here also the generated protected method
function TFiskalyManagementOpenApi._retrieveOrganization(aOrganization_id: string; const aResponse: TsgcOpenAPIResponse = nil): string;
var
oRequest: TsgcOpenAPIRequest;
begin
oRequest := TsgcOpenAPIRequest.Create;
Try
oRequest.Method := oapiHttpGET;
oRequest.Endpoint := '/organizations/{organization_id}';
oRequest.Security := oapiSecurityToken;
oRequest.Parameters.Add('organization_id', aOrganization_id, oapiInPath, true);
result := DoHTTP_REQUEST(oRequest, aResponse);
Finally
sgcFree(oRequest);
end;
end;
I hope this helps...