Idea Summary
It would be nice to have an option to override the stored credential used to execute a REST Data Source when using APEX_EXEC.EXECUTE_REST_SOURCE. This could be done with the addition of a parameter in the procedure. This enhances reusability of the same REST Data Source but with different credentials.
Additionally, this could be overwritten in the APEX Builder when using a native APEX region defined by a REST Data Source.
Use Case
Sometimes there's a need to use the same REST definition but with a different API key. For example, if different features in the same app are owned by different departments or funding sources. In one case we would have to copy the REST Data Source 3 times to do this with current features.
Preferred Solution (Optional)
Add an additional parameter to APEX_EXEC.EXECUTE_REST_SOURCE:
APEX_EXEC.EXECUTE_REST_SOURCE (
p_static_id IN VARCHAR2,
p_operation IN VARCHAR2,
p_url_pattern IN VARCHAR2 DEFAULT NULL,
p_credential_static_id IN VARCHAR2 DEFAULT NULL,
p_parameters IN OUT t_parameters );
https://docs.oracle.com/en/database/oracle/apex/24.2/aeapi/APEX_EXEC.EXECUTE_REST_SOURCE-Procedure-Signature-1.html
A null value would use the default defined in the REST Data Source definition..
Also add a way to override the credential when using a native APEX region based on a REST Data Source, similar to how we can assign parameter values.