Error with GUID using API POST

I created a Data Page API and am trying to POST a new record, but get an error. Id for that new record in JSON is generated from the Architect, the rest of the data is a copy of another record.
GET and DELETE work fine but with POST I have an issue. What I am doing wrong and how to fix it?

Screenshot from the Postman app:

      {
        "Status_Id": "376ae614-1381-4ff5-b894-9c96c7978ead",
        "Name": "Deactivate accounts XY",
        "AssignedTo_Id": "21c7c5cd-b373-43a6-aa40-aed4533686c2",
        "DueDate": "2025-11-30T00:00:00+01:00",
        "Priority_Id": "70a0e603-144e-4e90-b83b-4cd9b78e1469",
        "NotificationSent": false,
        "Description": "Deactivate all unused accounts",
        "Selected": false,
        "RecordCreated": "2025-11-07T10:30:20.227+01:00",
        "RecordUpdatedBy": "21c7c5cd-b373-43a6-aa40-aed4533686c2",
        "Id": "c76b135f-7df5-4e6c-ba35-8ab05d9f5331",
        "RecordCreatedBy": "21c7c5cd-b373-43a6-aa40-aed4533686c2",
        "RecordUpdated": "2025-11-07T10:36:42.963+01:00"
      }

Error log from ORIGAM Server:

2025-11-07 11:18:23 2025-11-07 11:18:23,263 [33] ERROR Origam.Server.Pages.UserApiProcessor - Error occured (System.Exception) for request:
2025-11-07 11:18:23                     localhost//api/public/tasks/: Error occured when setting parameter: @Task_parIdTask_parId to value:
2025-11-07 11:18:23 System.Exception: Error occured when setting parameter: @Task_parId to value:
2025-11-07 11:18:23  —> System.FormatException: Unrecognized Guid format.
2025-11-07 11:18:23    at System.Guid.GuidResult.SetFailure(ParseFailure failureKind)
2025-11-07 11:18:23    at System.Guid.TryParseGuid(ReadOnlySpan`1 guidString, GuidResult& result)
2025-11-07 11:18:23    at System.Guid..ctor(String g)
2025-11-07 11:18:23    at Origam.DA.Service.AbstractDataService.BuildParameters(QueryParameterCollection parameters, IDataParameterCollection dsParameters, UserProfile currentProfile)
                        in D:\a\1\s\backend\Origam.DA.Service\AbstractDataService.cs:line 425
2025-11-07 11:18:23    --- End of inner exception stack trace ---
2025-11-07 11:18:23    at Origam.DA.Service.AbstractDataService.BuildParameters(QueryParameterCollection parameters, IDataParameterCollection dsParameters, UserProfile currentProfile)
                        in D:\a\1\s\backend\Origam.DA.Service\AbstractDataService.cs:line 544
2025-11-07 11:18:23    at Origam.DA.Service.DataLoader.Fill()
                        in D:\a\1\s\backend\Origam.DA.Service\AbstractSqlDataService.cs:line 65
2025-11-07 11:18:23    at Origam.DA.Service.AbstractSqlDataService.LoadDataSet(DataStructureQuery query, IPrincipal principal, DataSet dataset, String transactionId)
                        in D:\a\1\s\backend\Origam.DA.Service\AbstractSqlDataService.cs:line 373
2025-11-07 11:18:23    at Origam.Workflow.DataServiceAgent.LoadData(DataStructureQuery query, DataSet data)
                        in D:\a\1\s\backend\Origam.Workflow\Service Agents\DataServiceAgent.cs:line 85
2025-11-07 11:18:23    at Origam.Workflow.DataServiceAgent.Run()
                        in D:\a\1\s\backend\Origam.Workflow\Service Agents\DataServiceAgent.cs:line 421
2025-11-07 11:18:23    at Origam.Workbench.Services.CoreServices.DataService.LoadData(Guid dataStructureId, Guid methodId, Guid defaultSetId, Guid sortSetId,
                        String transactionId, QueryParameterCollection parameters, DataSet currentData, String entity, String columnName)
                        in D:\a\1\s\backend\Origam.Workbench.Services\CoreServices\DataService.cs:line 92
2025-11-07 11:18:23    at Origam.Workbench.Services.CoreServices.DataService.LoadData(Guid dataStructureId, Guid methodId, Guid defaultSetId, Guid sortSetId,
                        String transactionId, QueryParameterCollection parameters)
                        in D:\a\1\s\backend\Origam.Workbench.Services\CoreServices\DataService.cs:line 59
2025-11-07 11:18:23    at Origam.Server.Pages.XsltPageRequestHandler.Execute(AbstractPage page, Dictionary`2 parameters, IRequestWrapper request, IResponseWrapper response)
                        in D:\a\1\s\backend\Origam.Server\Pages\XsltPageRequestHandler.cs:line 96
2025-11-07 11:18:23    at Origam.Server.Pages.UserApiProcessor.Process(IHttpContextWrapper context)
                        in D:\a\1\s\backend\Origam.Server\Pages\UserApiProcessor.cs:line 141

2025-11-07 12:26:33 2025-11-07 12:26:33,067 [14] ERROR Origam.Server.Pages.UserApiProcessor - Error occured (System.Exception) for request:
2025-11-07 12:26:33                     localhost//api/public/tasks/: Error occured when setting parameter: @Task_parId to value:
2025-11-07 12:26:33 System.Exception: Error occured when setting parameter: @Task_parId to value:
2025-11-07 12:26:33  —> System.FormatException: Unrecognized Guid format.
2025-11-07 12:26:33    at System.Guid.GuidResult.SetFailure(ParseFailure failureKind)
2025-11-07 12:26:33    at System.Guid.TryParseGuid(ReadOnlySpan`1 guidString, GuidResult& result)
2025-11-07 12:26:33    at System.Guid..ctor(String g)
2025-11-07 12:26:33    at Origam.DA.Service.AbstractDataService.BuildParameters(QueryParameterCollection parameters, IDataParameterCollection dsParameters, UserProfile currentProfile)
                        in D:\a\1\s\backend\Origam.DA.Service\AbstractDataService.cs:line 425
2025-11-07 12:26:33    --- End of inner exception stack trace ---
2025-11-07 12:26:33    at Origam.DA.Service.AbstractDataService.BuildParameters(QueryParameterCollection parameters, IDataParameterCollection dsParameters, UserProfile currentProfile)
                        in D:\a\1\s\backend\Origam.DA.Service\AbstractDataService.cs:line 544
2025-11-07 12:26:33    at Origam.DA.Service.DataLoader.Fill()
                        in D:\a\1\s\backend\Origam.DA.Service\AbstractSqlDataService.cs:line 65
2025-11-07 12:26:33    at Origam.DA.Service.AbstractSqlDataService.LoadDataSet(DataStructureQuery query, IPrincipal principal, DataSet dataset, String transactionId)
                        in D:\a\1\s\backend\Origam.DA.Service\AbstractSqlDataService.cs:line 373
2025-11-07 12:26:33    at Origam.Workflow.DataServiceAgent.LoadData(DataStructureQuery query, DataSet data)
                        in D:\a\1\s\backend\Origam.Workflow\Service Agents\DataServiceAgent.cs:line 85
2025-11-07 12:26:33    at Origam.Workflow.DataServiceAgent.Run()
                        in D:\a\1\s\backend\Origam.Workflow\Service Agents\DataServiceAgent.cs:line 421
2025-11-07 12:26:33    at Origam.Workbench.Services.CoreServices.DataService.LoadData(Guid dataStructureId, Guid methodId, Guid defaultSetId, Guid sortSetId,
                        String transactionId, QueryParameterCollection parameters, DataSet currentData, String entity, String columnName)
                        in D:\a\1\s\backend\Origam.Workbench.Services\CoreServices\DataService.cs:line 92
2025-11-07 12:26:33    at Origam.Workbench.Services.CoreServices.DataService.LoadData(Guid dataStructureId, Guid methodId, Guid defaultSetId, Guid sortSetId,
                        String transactionId, QueryParameterCollection parameters)
                        in D:\a\1\s\backend\Origam.Workbench.Services\CoreServices\DataService.cs:line 59
2025-11-07 12:26:33    at Origam.Server.Pages.XsltPageRequestHandler.Execute(AbstractPage page, Dictionary`2 parameters, IRequestWrapper request, IResponseWrapper response)
                        in D:\a\1\s\backend\Origam.Server\Pages\XsltPageRequestHandler.cs:line 96
2025-11-07 12:26:33    at Origam.Server.Pages.UserApiProcessor.Process(IHttpContextWrapper context)
                        in D:\a\1\s\backend\Origam.Server\Pages\UserApiProcessor.cs:line 141

Please attach also the definition of the API page.

I’d also expect using PUT instead of POST when creating new record.

I would expect that a POST/PUT data page API wouldn’t be filtered with a parameter @Task_parId if you are trying to save a new record.

The problem is the last / after tasks in your URL. If you are putting slash at the end, it will resolve into the URL that expects task id. Which you did not provide in the URL. So you are getting the error.

If you wanted to make a PUT request without the task id, you have to call /api/private/tasks not /api/private/tasks/.

What would help here to diagnose the problem maybe a little bit more easily would be to include the name of the resolved API from the model and also its modeled URL. Something like:

2025-11-07 11:18:23 2025-11-07 11:18:23,263 [33] 
  ERROR Origam.Server.Pages.UserApiProcessor - 
  Error occured (System.Exception) for request:
2025-11-07 11:18:23 localhost//api/public/tasks/:
2025-11-07 12:26:33 Error occurred while processing API page 
  Name: /api/private/tasks/{taskId} 
  Url: /api/private/tasks/{taskId}
  Exception: Error occured when setting parameter: @Task_parId to value:
2025-11-07 12:26:33  —> System.FormatException: Unrecognized Guid format.

A post was merged into an existing topic: Introduce Verb Mapping to APIs

A post was split to a new topic: Introduce Verb Mapping to APIs

I used the PUT method + link without slash at the end (https://localhost/api/public/tasks) + the record insert data in the body but now I get 404 error. The same request with GET works fine, but when using PUT it says “Requested resource could not be found.”…

Your body that you send should look exactly the same as when you retrieve the data using GET. That means you are missing the entity name and ROOT elements in your JSON.

So here is the summarization:

  • Currently only PUT and DELETE commands are in operation, where PUT both updates and creates a new record. POST will not produce an error, but will do nothing.
  • Any API that needs to work with a specific record needs an Id parameter to be defined (e.g.: Entity_parId)
  • Any API that needs to create a new record needs a parameter for the body to be defined (e.g.: Entity_body)
  • The data in the body for a new record creation need to include all the brackets and “ROOT” as you get it using the GET command:
{
  "ROOT": {
    "Entity_name": [
      {
        "Field_name": "Value",
        "Field_name2": "Value 2"
      }
    ]
  }
}
  • Id needs to be located both in the body and in the linke, e.g.:
    https://localhost/api/public/tasks/d4deda37-376b-47d2-894e-7359978f587a

Complete instruction on how to create an API can be found here - How to create a simple API

That not is not exactly correct.

  • POST works, but is mostly used in Workflow pages
  • in general, the data to create a new record (a PUT request) needs to have the same structure as is defined in the data structure of the data page, because the data is usually not further processed and is directly saved to the database
  • in your example, the Id parameter is only needed for a GET request, also it can be added as a separate parameter that is not defined as part of the url, it is not needed for a PUT request

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.