Trying to create a custom event.
user_data = { "os" => "Android", "browser_fingerprint_id" => "1"}
options = { body: { branch_key: Credentials.get(:branch_key), branch_secret: Credentials.get(:branch_secret), name: 'purchase_completed', user_data: user_data } }
response = post('https://api.branch.io/v2/event/custom', options)
have tried different ways of sending user_data, but getting the same error.
user_data = { os: 'Android', browser_fingerprint_id: '1' }
user_data = { "os": "Android”, "browser_fingerprint_id":"1" }
user_data = { "developer_identity": "user123" }
My HTTP is working fine.
For example for creating a deep link URL, I do that via HTTP and get a 200 response.
data = { "$canonical_identifier" => "content/123", "og_title" => "Title from Deep Link", "og_description" => "Description from Deep Link", "og_image_url" => "http://www.lorempixel.com/400/400/", "desktop_url" => "http://www.example.com", custom_boolean: true, custom_integer: 1243, custom_string: "everything", custom_array: [1,2,3,4,5,6], custom_object: { "random": "dictionary" } }
options = { body: { branch_key: Credentials.get(:branch_key), branch_secret: Credentials.get(:branch_secret), channel: 'facebook', feature: "onboarding", campaign: "new product", stage: "new user", tags: ["one", "two", "three"], data: data } }
response = post('https://api2.branch.io/v1/url', options)
Please could you help debug this.
Thanks.