Open311 API Configuration

I’m attempting to build an API within Liberty Create that aligns with the Open311 specification.

The specification includes endpoints in the following format:

https://[api-endpoint]/services/[service_code].[format]

For example:

https://api.city.gov/dev/v2/services/033.xml

The issue I’m facing is that the inclusion of .[format] within the URL causes the API function to fail in Liberty Create.

Has anyone successfully implemented an endpoint that supports this URL pattern? If so, is there a recommended approach or workaround to allow this format?

Many thanks,

Karl

Are you trying to call an external API or create an internal API for external systems to call?

@aphillips012 Sorry if I wasn’t clear, I’m trying to build an internal API that would be called by an external organisation.

My URL is currently /Services

However the specification dicates that the external organisation will call /services.xml for example.

I think you might specify that in the function, rather than in the endpoint. There’s an option to specify that the payload for the request/response is XML based, which i think might do what you want? Mostly just a guess though i’m afraid.

Thanks, I can’t see anything obvious within the function. The function name only allows for alpha-numeric characters and underscores.

It almost appears that I need some sort of URL pre-processor.

When you go to define the payloads for the function you should get the option to select the format. That seems to be the only place to define it. If that’s not it then i’m not sure how you’d do it.