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

[BRANCH SERVER ISSUE] Updating a url removes existing keys #20

Closed stevenmyhre closed 7 years ago

stevenmyhre commented 7 years ago

I wish to add property to a url after the link is used. When I issue a PUT in accordance to the documentation, with the new data property, all other existing properties are removed.

Repo:

  1. POST /v1/url with any number of properties in data, returning a url
  2. PUT /v1/url?url=<url> with body like this:
{
    "branch_key": "key_live_xxxxxx",
    "branch_secret": "secret_live_xxxxxx",
    "data": {
        "valid": true,
        "something": "else"
    }
}

The response only includes the "valid" and "something" properties, with everything else removed.

For now I will have to do a GET on the existing url to get the existing data and then post it back. Would prefer not to do the extra request.

ahmednawar commented 7 years ago

@stevenmyhre sorry for the late reply and thanks for the feedback. This is actually the expected behavior, although I agree it is not very intuitive and not well-documented. It behaves this way because it allows you delete existing data by not including it in the request payload. Makes sense?

I will relay your feedback to our API team and we'll see what we can do.