When creating an ad creative with a link that contains special characters (e.g., &, spaces), the SDK does not URL-encode the link automatically. This leads to the following error:
{
"message": "Invalid parameter",
"type": "OAuthException",
"code": 100,
"error_subcode": 1815166,
"error_user_title": "Invalid creative's object story spec",
"error_user_msg": "Invalid creative's object story spec, please check the format of your object story spec."
}
Fix:
Manually encoding the URL using encodeURI(...) before passing it in the object_story_spec.video_data.call_to_action.value.link resolved the issue.
Please either:
Automatically encode the link in the SDK
Or document clearly that links must be properly encoded by the developer
When creating an ad creative with a link that contains special characters (e.g., &, spaces), the SDK does not URL-encode the link automatically. This leads to the following error:
{
"message": "Invalid parameter",
"type": "OAuthException",
"code": 100,
"error_subcode": 1815166,
"error_user_title": "Invalid creative's object story spec",
"error_user_msg": "Invalid creative's object story spec, please check the format of your object story spec."
}
Fix:
Manually encoding the URL using encodeURI(...) before passing it in the object_story_spec.video_data.call_to_action.value.link resolved the issue.
Please either:
Automatically encode the link in the SDK
Or document clearly that links must be properly encoded by the developer