Skip to content

SDK does not automatically encode URLs, causing object_story_spec failure #310

@urielTwist

Description

@urielTwist

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions