Youxun Shen
Youxun Shen

Reputation: 218

How do I add users to value-based custom audience via API

The following is my request:

curl -X POST https://graph.facebook.com/v2.11/{customer_audience_id}}/users -d '{"payload": {"data": [["test@mail.com"]], "schema": ["EMAIL"]}}' -H "Content-Type: application/json" -H "Authorization: Bearer {ACCESS_TOKEN}

And the Response is:

{"error":{"message":"(#100) Weighted Custom Audience requires weight attribute.","type":"OAuthException","code":100,"fbtrace_id":"123123123"}}

If add one field 'WEIGHT' into the request:

curl -X POST https://graph.facebook.com/v2.11/{customer_audience_id}}/users -d '{"payload": {"data": [["test@mail.com", 100]], "schema": ["EMAIL", "WEIGHT"]}}' -H "Content-Type: application/json" -H "Authorization: Bearer {ACCESS_TOKEN}

The response becomes:

{"error":{"message":"(#100) Raw PII type is invalid, it should be one of EXTERN_ID,EMAIL,PHONE,GEN,DOBY,DOBM,DOBD,LN,FN,FI,CT,ST,ZIP,MADID,COUNTRY,PARTIALPHONE,PHONEID,STREETNAME,STREETNUM,STREETTYPE,STREET2ROW,STREETADDRESS,APPUID,PAGEUID,F5FIRST,F5LAST,EMAIL_MD5,PHONE_MD5","type":"OAuthException","code":100,"fbtrace_id":"123123123"}}

Seems like the weight variable is not even in the list of supported parameters. My question is: Is it possible to add users into value-based custom audience through API? I cannot find any references on the documentation page.

Upvotes: 4

Views: 574

Answers (0)

Related Questions