Questions on API Integration: Methods, URL Generation, and Error Handling
- How can I determine which HTTP method was used to call a flow that is configured to publish as an API?
- Why doesn't the GET URL generate when we have complex types defined as input for the flow?
- Can we retrieve only user-defined integrations using /APIDOC?
- The set of parameters defined for POST requests are not required for GET requests but still appear in the URL. Why is this?
- How can I generate a 404 API response?
Comments
-
Following are the details\answers for the above questions regarding API integration:-
- In the Data Explorer under Flow Data > HttpMethod, we can find a Flow Constant Data named "HttpMethod". This contains the HTTP method (GET, POST, PUT) used to call the flow.
- The GET URL will not be generated for flows where complex input types are defined. This is because JSON data is required to supply composite types, which cannot be effectively passed through a query string designed for basic types. For example, a basic type URL looks like this: site?input1=value1&input2=value2. However, for complex data, nesting and JSON parsing are necessary, which isn't feasible in URLs. An example of such a URL would be: site?data={inputs: [ {input1: value1},{input2: value2} ] }.
- Currently, we cannot ensure that only user-defined integrations will appear using APIDOC (/apidoc), as this functionality operates in a default manner that we do not control.
- It's expected that variables appear in the query string of a GET URL. This is standard for GET requests, where all inputs or data are part of the URL itself.
- To generate a 404 API response, we can utilize the "Throw API Exception" step, which fulfills this requirement effectively.
Howdy, Stranger!
Categories
- 4.1K All Categories
- 61 General
- 11 Training
- 201 Installation / Setup
- 1.1K Flows
- 106 Rules
- 260 Administration
- 212 Portal
- 489 General Q & A
- 693 Forms
- 333 Reports
- 3 Designer Extensions
- 47 Example Flows
- 51 CSS Examples
- 1 Diagram Tile
- 7 Javascript Controls
- 178 Pages
- 5 Process Mining
- New Features
- 178 Datastructures
- 69 Repository
- 219 Integrations
- 28 Multi-Tenant
- 27 SDK
- 76 Modules
- 56 Settings
- 25 Active Directory
- 12 Version 7
- 35 Version 8
- 66 Lunch And Learn Questions