☝️Small business or a startup? See if you qualify for our special offer.
+

Is the "type" value required when requesting custom api?

Answered
jhshin asked on May 12, 2025

Is the "type" value required when requesting custom api? It is indicated as a required value in the document, but when I actually run the example code, I can send the type without putting it in the body, or I can send it other than the four types defined (fields, member, select, and handshake) without ignoring it. Isn't it unnecessary because it's already distinguishable by api endpoint?

1 answer

Public
Maksym Diachenko Maksym Diachenko Flexmonster May 12, 2025

Hello,

Thank you for writing to us.

Your observation is correct for most scenarios, when the API endpoints include the request type, and the type property can be safely ignored. However, the type property is required for specific custom API connection approaches, where distinguishing by the request URL is impossible. These scenarios include:

  1. When using a singleEndpoint data source option, custom data source API requests are sent to a single endpoint specified in the url property.
  2. When using a functional API approach, which allows a JS callback function to be used as the custom data source API endpoint, adding a client-side request/response processing layer: https://jsfiddle.net/flexmonster/h3k2qwe1/

The type is always included in requests to ease the transition to these connection approaches.

Please let us know if our answer helped you.

Best Regards,
Maksym

Please login or Register to Submit Answer