Issue passing an empty array using HTTP module

I am using the HTTP module to talk to the Meta Business API in order to create a Campaign. I can do this successfully using the Graph API Explorer and the following POST command:

https://graph.facebook.com/v19.0/act_XXXXXXXX/campaigns?name=My+campaign1&objective=OUTCOME_ENGAGEMENT&status=PAUSED&special_ad_categories=%5B%5D

In Make, I set up an HTTP module like this:

I am getting this error: “The parameter special_ad_categories is required”.

As per the Meta docs, I need to pass in an array for this parameter. In my case, there are no special categories, so I want to pass in an empty array. I have tried to do this with [], with %5B%5D and with NONE but I cannot get past this error. Any ideas appreciated!

Barnaby

Hi @Barnaby_Marshall
in meta API they mention that you can send empty array or NONE
so try to pass [“NONE”]

2 Likes

Thanks for the suggestion @Dorian_Ben_Haim unfortunately that did not work:

it seems from the Graph API explorer that the value that works is simply two square brackets with nothing between them, which are URL escaped in that instance, i.e. %5B%5D. I guess the challenge is to pass the equivalent of that in the JSON Body…

i think i found the issue
the content-type should be
image

2 Likes

That worked @Dorian_Ben_Haim, thank you so much!

Hopefully this will be useful to someone else.

3 Likes