API POST call - Make a field in JSON object optional?

@Bubble, without creating separate API calls for all POST variations, is there a way to make the fields in the JSON object optional? For instance, in the screenshot below I would like the CC Address to be optional. Currently, if I do not specify a CC address in my app’s workflow, when the POST action runs it’s taking the value I specified in the API settings of the screenshot below. The same for the Content field. Ideally someone should be able to send an email with only a subject, but if I do that in my app, the “this is a test” is going to be sent.

@Kfawcett Could you give more context on the block in this use case? For example, does an empty ccAddress flag issues?

If I try to clear the ccAddress in the plugin editor, then when I run the workflow in the app it throws the below error. I think it’s because I have specified the structure and Bubble doesn’t remove key:value pairs if they are blank like it does if Bubble had automatically generated the call structure during initialization. Since this is a POST I’m unable to automatically generate it. So, I think there needs to be an “optional” checkbox for the array of objects (e.g ccRecipients).

Workflow error - Raw error from Microsoft Graph v1.0 Self Auth - SendMessage: {
 "error": {
 "code": "ErrorInvalidRecipients",
 "message": "At least one recipient isn't valid., Recipient \"null\" isn't resolved. All recipients must be resolved before a message can be submitted.",
 "innerError": {
 "request-id": "cc13ce07-a0b1-469f-8683-2febd518b311",
 "date": "2019-01-12T18:09:16"
 }
 }
 }

@Kfawcett Thanks for the additional context. Changing behavior for the key value pair is not a quick fix at the moment. The workaround would be to send something in that field that does not give an error.

Ok, thanks @neerja. I’ll setup two separate calls and use workflow conditions to determine which to use.

Hopefully this is something that could be put on the backlog for future enhancement.

Hi.
Is this being worked on?

Having to make a separate calls when you have many fields doesn’t seem very efficient.
Being able to ignore an empty field seems the better way.