Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to make image beacon work (400 Bad request errors) #291

Closed
Yonezpt opened this issue Jun 20, 2015 · 2 comments
Closed

Unable to make image beacon work (400 Bad request errors) #291

Yonezpt opened this issue Jun 20, 2015 · 2 comments

Comments

@Yonezpt
Copy link

Yonezpt commented Jun 20, 2015

I have been trying to load a simple image beacon to test the data collection, but it is always returning a 400 bad request error. I am using the following url for the image beacon created by following the examples in the guides:

https://api.keen.io/3.0/projects/ <my project id> /events/event_collection_test?api_key= <my write key> &data=%7B%22campaign%22%3A%20%22Awesome%20analytics!%22%2C%22subject%22%3A%20%22Hi%22%2C%22text%22%3A%20%22Image%20beacons%20are%20fun.%22%7D
@jshirley
Copy link

Hi Yonezpt, the data portion of the URL parameter must be Base64 encoded and a JSON string.

You can use the JavaScript btoa method to create the base64 portion, and most other languages have native Base64 encoding functions.

In JavaScript, this likely looks like: btoa(JSON.stringify({ campaign: "Awesome analytics!" }))

Hope that helps!

@Yonezpt
Copy link
Author

Yonezpt commented Jun 20, 2015

That did the trick, thanks for the quick response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants