BranchMetrics / branch-deep-linking-public-api

The Branch Metrics public API for mobile deep linking / deeplinking applications. Branch helps mobile apps grow with deep links / deeplinks that power referral systems, sharing links and invites with full attribution and analytics.
https://dev.branch.io/references/http_api/
145 stars 18 forks source link

Wrong response when POSTing a new link #16

Closed grmmph closed 8 years ago

grmmph commented 8 years ago

We have a custom domain configured in our dashboard. We've tested it with marketing links generated via branch's UI.

The problem is, that when trying to generating a link via POSTing to url endpoint, the response received is xxx.app.link and not our pretty custom domain.

But wait, It's getting weirder! The app.link prefix we get is inconsistent to the app.link configured in our dashboard, while the whole app.link thing is inconsistent with the fact our app still uses the old bnc.lt.

For example:

So sometime branch.io uses the bnc.lt, sometime it uses our custom domain and sometimes it uses app.link with a (probably) wrong prefix.

Not very inconsistent I'd say :) Nevertheless, the breaking issue here for me is that I'm not able to generate custom-domain links programmatically.

Thanks a good day!

grmmph commented 8 years ago

Ok, seems like the main issue caused because of confusion with the branch api live and test keys.

But still it could be improved:

aaustin commented 8 years ago

Hey @grmmph - I'm super sorry that you went through this torture. Key mixups are unfortunately all too common. We added that system to help companies better segment their test data from live data, but it seems like it sometimes adds more pain than benefit.

On your suggestions, we worry about unifying links between the two accounts, because it allows potentially bad behavior where people launch with the incorrect keys and can use them interchangeably. It's one of the reasons that we now create all links with test-app.link on the test account, to help prevent this confusion.

On type:2 not creating a marketing link, I just checked that this should still be working. Can you make sure you're passing it as an integer and not a string? I thought we handle both but it's possible that's not the case.

grmmph commented 8 years ago

Thanks for quick reply @aaustin!

Indeed using the test key was a stupidity on my side. But Actually, I didn't get xxx.test-app.link as you suggested, but the xxx.app.link - maybe if I would have get the test-app response I would realize much faster I'm using a wrong key. Maybe something to improve on your side?

Yes, type: 2 was passed as integer at the root of the params object (not an attribute of data)

aaustin commented 8 years ago

Hey @grmmph - I just tried this curl for a test app I have: curl -X POST -H "Content-Type: application/json" -d '{"channel":"test","campaign":"test123","type":2,"data":"{\"$always_deeplink\":false}","branch_key":"key_live_gpk6Xg4wInPq1IYbxwG4akjhqDc7bplS"}' https://api.branch.io/v1/url

Upon reloading the marketing page, the link appeared. Can you send over an example request you make where this doesn't happen? I can help dig in there.

aaustin commented 8 years ago

Going to close the issue for now.