Open greg-md opened 1 month ago
Hello,
When an email address contains special characters like +, the request fails with 400 invalid email parameter error:
+
statusCode: 400, serviceCode: 'InvalidParameter', opcRequestId: '43FCB4E031F8-11EF-8CD1-BF8CE55FC/2B6CD7C119E2429B8D904913FEAEF72E/95DB72DF682D438C8464F14B2370B445', targetService: 'Email', operationName: 'listSuppressions', timestamp: '2024-06-24T07:06:23.407Z', requestEndpoint: 'GET https://ctrl.email.us-phoenix-1.oci.oraclecloud.com/20170907/suppressions?compartmentId=ocid1.tenancy.oc1..aaaaaaaa3wam7rmtqbw7nktj6vd6pagns43c2afnohud6swc7dehqrbzolva&emailAddress=foo+bar@domain.com', clientVersion: 'Oracle-TypeScriptSDK/2.81.0',
Based on requestEndpoint from the log, seems like the email was not url encoded, so I had to manually url encode email address before calling the SDK:
requestEndpoint
const client = new EmailClient({ authenticationDetailsProvider: provider }); const listSuppressionsResponse = await client.listSuppressions({ compartmentId: provider.getTenantId(), emailAddress: encodeURIComponent(email), });
But it would be good if SDK will url encode query parameters by itself.
Hello,
When an email address contains special characters like
+
, the request fails with 400 invalid email parameter error:Based on
requestEndpoint
from the log, seems like the email was not url encoded, so I had to manually url encode email address before calling the SDK:But it would be good if SDK will url encode query parameters by itself.