Hello everyone, hope you all are well! I need help with in how to send the Location property of the headers in my User Defined API response. I didn't find any information in the documentation abut it, but our client requires that information in the headers of the response.
I'll leave the output of my api here:
return new ApiTriggerOutput
{
ResponseBody = responseMessage,
ResponseCode = 201,
};
Thank you in advance!

Hi Marieke! Yes, i still need help with this problem, after my last anwser to Wouter, i didn't get a response. This feature will be added to the backlog to development or someone can help me in another way?

From previous communication, it seems the goal is to include a URI in the header. If this is meant to indicate the location of a newly created resource (as in a 201 Created response), that’s a standard and well-supported practice under RFC 9110.
That said, depending on the type of object being created in DataMiner, a consistent or meaningful URI may not always be available. Which objects do you need to point to?
If the intent is different—e.g., using the header to carry other types of information—this would be non-standard, and we’d prefer to avoid it to keep the API clean and predictable.
Hi Jan-Klaas, the uri that we need to send in the header will be /api/jobs/${jobId}. The "jobId" will be a variable value generated by an User-defined API automation.

Great, thanks for the confirmation. I've created this feature request with the details: https://community.dataminer.services/new-feature-suggestions/setting-the-location-header-in-responses-of-user-defined-api/
After doing an effort estimation, we can then start drafting a timeline. Tentatively, we’re looking at either October 17 (10.5.11) or November 14 (10.5.12) for the release of this new feature.
Hi João,
Unfortunately, setting headers on a User-Defined API response is not something we currently support. The only way to add data to a response currently, is using the ResponseBody.
I can maybe help you looking for a workaround. Just to make sure I understand you correctly, do you want to get the Location header from the User-Defined API request? Or do you want to add the Location header to the headers of your API response?
Hi Wouter, thank you for your response! I want to add the Location header to the headers of my API response.

Ok, I'm assuming, since you use the 201 Created status code in your response, that your Location header will include the location of a resource that your API creates? Would it be an option to include this location in the ResponseBody? I'm afraid that is the only way to currently work around this limitation. I will link this Dojo question to a task on our backlog to implement HTTP headers, that way I can inform you if we would at some point in the future would implement this.
I will talk to our client and see if he accepts sending via ResponseBody, as soon as I have a position I will get back to you. Thank you for your help Wouter!
Hi Wouter! I spoke to our client and they need it to be sent via Location in the response Header, because according to them, the system was developed following this logic. If you have a deadline for that implementation we like to know. Thank you in advance and my regards!

Hi João, will this location header always contain the same location? Because in that case, we could as a workaround make a rewrite rule in IIS that sets this header hardcoded on every response.
I see that this question has been inactive for some time. Do you still need help with this? If not, could you select the answer (using the ✓ icon) to indicate that no further follow-up is needed?