Coder Social home page Coder Social logo

branchmetrics / branch-deep-linking-public-api Goto Github PK

View Code? Open in Web Editor NEW
144.0 144.0 18.0 237 KB

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.

Home Page: https://dev.branch.io/references/http_api/

branch-deep-linking-public-api's People

Contributors

aaaronlopez avatar aaustin avatar agrimn avatar ahmednawar avatar austinhay avatar derrickstaten avatar dmitrig01 avatar dwestgate avatar ethanneff avatar gfletcher-branch avatar hana-branch avatar jakecadams avatar mgerner avatar parthkalavadia avatar pccyang avatar qinweigong avatar rubinsingh avatar sarkar avatar snakingfire avatar tchingos-branch avatar thinkscape avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

branch-deep-linking-public-api's Issues

Bulk creating Deep Linking URLs not preserving the order

When multiple branch links are created , the order of URL's in response is changed.
So, we are unable to identify for which item the URL belongs.
Or if at least some other request parameters other than URL was returned back, we could identify the URL.
Or is there any other work around for this?

Thanks.

Updating an existing link overrides existing data

I do two requests.

Creating link

{ url: 'https://api.branch.io/v1/url',
  json: true,
  headers: { 'Content-Type': 'application/json' },
  body: 
   { branch_key: 'key_test_***',
     channel: 'IvySpace',
     data: { roboadvisor_form_id: 5 } } }

Note that I added custom data roboadvisor_form_id

Updating the created link

{ url: 'https://api.branch.io/v1/url',
  qs: { url: 'https://ivyspace.test-app.link/WIUn37uT3L' },
  json: true,
  headers: { 'Content-Type': 'application/json' },
  body: 
   { branch_key: 'key_test_***',
     branch_secret: 'secret_test_***',
     data: 
      { '$android_wechat_url': 'https://www.ivyspace.com/wechat?branch=https%3A%2F%2Fivyspace.test-app.link%2FWIUn37uT3L',
        '$ios_wechat_url': 'https://www.ivyspace.com/wechat?branch=https%3A%2F%2Fivyspace.test-app.link%2FWIUn37uT3L' } } }

After updating the link custom data roboadvisor_form_id is gone.
In https://ivyspace.test-app.link/WIUn37uT3L?debug=1 I see the following:

{
"$android_wechat_url": "https://www.ivyspace.com/wechat?branch=https%3A%2F%2Fivyspace.test-app.link%2FWIUn37uT3L",
"+url": "https://ivyspace.test-app.link/WIUn37uT3L",
"~creation_source": 0,
"$one_time_use": false,
"~id": "513040571548724556",
"~channel": "IvySpace",
"$ios_wechat_url": "https://www.ivyspace.com/wechat?branch=https%3A%2F%2Fivyspace.test-app.link%2FWIUn37uT3L"
}

This is inconsistent with what it says in the docs:

The new link returns existing data of the link plus the newly added data of the link.

REST api error message when creating a new deep link

Hey there,

  • i have detected a new issue with the branch REST API (api2.branch.io/v1/url), when sending the showcased JSON payload in the branch io official documentation to the api to create a deep link i get the following error message :

{ "error": { "code": 400, "message": "The following key(s) are restricted link data keys. Please remove them or replace with valid link data key(s): ~creation_source, ~stage, +match_guaranteed, +is_first_session, +click_timestamp" } }

POST https://api2.branch.io/v1/url
{ "branch_key":"key_test_YOURKEY", "randomized_bundle_token": "427469360685348303", "link": "https://example.app.link?%24randomized_bundle_token=427469360685348303", "session_id": "429691081177874743", "data": { "$canonical_identifier": "item/1503684554354.28", "$canonical_url": "https://example.com/home?utm_campaign=test&deeplink=value", "$desktop_url": "http://example.com/home", "$randomized_bundle_token": "427469360685348303", "$og_description": "My Content Description", "$og_image_url": "http://lorempixel.com/200/200/", "$og_title": "46D6D28E-0390-40E4-A856-BD74F34D24C8", "$publicly_indexable": 1, "+click_timestamp": 1503684563, "+clicked_branch_link": true, "+is_first_session": false, "+match_guaranteed": true, "custom": "blue", "random": "FE848A5B-78F7-42EC-A253-9F795FE91692", "added": "1503684554354.33", "~campaign": "new launch", "~channel": "facebook", "~creation_source": 3, "~feature": "sharing", "~id": 429691043152332059, "~referring_link": "https://example.app.link/X7OsnWv9TF", "~stage": "new person", "~tags": [ "one", "two" ] } }

did anyone face this issue recently also with the api ?

Thank you.

Get developer identity from link

I would like to get the developer identity from a link. The the url get call gives you an identity_id for the link, but there doesn't seem to be an API to go from the identity_id to the developer identifier.

The use case is that we want to know what email address (the developer identity) referred another user.

Undocumented endpoint to get original link url?

Hi,

some context
In order to implement our custom landing pages, we needed to get some of the info that was used to create the branch link to show user name and photo form the landing. since the only thing we have available from the web after a successful redirection is the _branch_match_id and not the complete branch url, we are calling /v1/url with this _branch_match_id. This returns the original url, which we can then use to call the same endpoint, and get the original data.

question/bug

  • since this API functionality is not documented, can we actually rely on it to get the original url?
  • if not, what is the best way for us to get the original information from the _branch_match_id?

thanks

cc @julian-amaya, @jseros

Wrong response when POSTing a new link

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:

  • In dashboard's link settings, under "Custom Link Domain" We've got a disabled input field with the value bnc.li
  • Underneath we've configured our own domain awesome.domain
  • Our app.ink prefix is (e.g.) abcd, at least according to the note under the SHA256 Cert Fingerprints input field.
  • When creating marketing links via branch dashboard, the link format would be awesome.domain/awesome-link
  • When our app received a url from WhatsApp, we get bnc.lt/random-link-id
  • When generating link via branch API (or branch.link(options)), the response is wxyz.app.link/alias-or-random-id but not awesome.domain/alias-or-random-id as expected.
  • Assigning type: 2 doesn't create a marketing link as documented.

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!

Errors in react-native SDK docs

Docs in several cases refer to snake_case arguments, but the actual SDK seems to expect camelCase.

In particular, I'm looking at the example code for custom events. The react native instructions refer to custom_data, but inspecting the SDK during development, it seems to expect customData.

A quick skim through the docs, I'm suspicious that there are several other places with similar issue, however, I haven't verified against the code.

[BRANCH SERVER ISSUE] Updating a url removes existing keys

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.

Making POST request to POST /v1/url

I can't figure out how to use the /v1/url endpoint. I am making a POST request with curl and passing in the app_id (which I assume is my itunes id, is this right?) and the identity.

In which format do you expect the api key? Right now the endpoint returns the following:

{
    "error": {
        "code": 500,
        "message": "The server could not complete your request as specified. Please try again at a later time."
    }
}

The returned message is not very helpful.
Can you help here?

$after_click_url breaks detection of user having app

If you set $after_click_url, the data passed in init (or shown in the banner) can no longer detect that the user has the app, will always default to data.has_app = false;
has_app is not set in sessionStorage before redirecting.

Error can't set key "type": 2 when create deep link

Hello Branch Team and @aaustin

There are an issue that I just faced during create deep link via rest api "/v1/url".
{
"error": {
"code": 403,
"message": "You don't have access to this type. Please try again with type 0 (default) or 1."
}
}

I've tried to create deep link via rest api and wan to make it available to show in dashboard on Quick Link menu. I've followed this the suggestion from this https://help.branch.io/faq/docs/can-we-see-api-generated-links-on-the-dashboard and it's got success as expected. But just now I can't access the value 2 of key "type" anymore. It showed error as above.

Does anyone use to faced that issue? Please kindly shared your solution. It's my appreciation all all help.

Thanks

Question: automate process of creating and configuring new apps

Hello branch io team!

This is not an issue, just a question, I didn't find anything related to it in documentation.

Is it possible to automate the process of creating and setting up branch io for multiple apps? I have a multi-tenant architecture and want to automate this process for every new app.

These are the steps that I need to fulfill from Dashboard:

  1. Create New App
  2. Configure require redirects (I think this provides me enough)
  3. Get default/alternate link domains

Error with user_data while creating custom event

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)

The error is {"user_data"=>"missing required field"}}

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)

So, the error is happening only with user_data and while making the request via HTTP.

Please could you help debug this.

Thanks.

CURL for creating link not working

I'm trying to create a link using the HTTP API. There seems to be a hang when running the example you give. I'm replacing the branch key with my own:

curl -X POST \
\
-H "Content-Type: application/json" \
\
-d '{"branch_key":"key_live_feebgAAhbH9Tv85H5wLQhpdaefiZv5Dv", "campaign":"new_product_annoucement", "channel":"email", "tags":["monday", "test123"], "data":"{\"name\": \"devon\", \"email\": \"[email protected]\", \"user_id\": \"12346\", \"$deeplink_path\": \"article/jan/123\", \"$desktop_url\": \"https://branch.io\"}"}' \
\
https://api.branch.io/v1/url

This is the response:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>ERROR: The request could not be satisfied</TITLE>
</HEAD><BODY>
<H1>ERROR</H1>
<H2>The request could not be satisfied.</H2>
<HR noshade size="1px">
CloudFront attempted to establish a connection with the origin, but either the attempt failed or the origin closed the connection.
<BR clear="all">
<HR noshade size="1px">
<PRE>
Generated by cloudfront (CloudFront)
Request ID: nX4nnKfBBLgGIvy8eByuIBRpxZHuRIs9KFYTGSROi8y0ZgPvWzTliQ==
</PRE>
<ADDRESS>
</ADDRESS>

Any ideas?

Unable to set uri scheme which contains numbers

Hi,

Whenever I try to create/update branch app configuration with following parameters, I get an error:

{:user_id=>"99339170534654343",
 :app_name=>"Gamedev",
 :dev_name=>"Zerista Developer",
 :dev_email=>"[email protected]",
 :android_url=>"com.zerista.gamedev2015",
 :android_uri_scheme=>"com.zerista.gamedev2015://",
 :web_url=>"https://gamedev.zerista.com",
 :ios_url=>"id2",
 :app_id=>"101089275252048462"}
{"error":{"code":400,"message":"Invalid Android URI scheme"}}

However this request goes through fine:

{:user_id=>"99339170534654343",
 :app_name=>"Gamedev",
 :dev_name=>"Zerista Developer",
 :dev_email=>"[email protected]",
 :android_url=>"com.zerista.gamedev",
 :android_uri_scheme=>"com.zerista.gamedev://",
 :web_url=>"https://gamedev.zerista.com",
 :ios_url=>"id2",
 :app_id=>"101089275252048462"}

Response

{"app_key":"101089275252048462","creation_date":"2015-03-02T23:43:07.961Z","app_name":"Gamedev","origin":null,"dev_name":"Zerista Developer","dev_email":"[email protected]","android_url":"com.zerista.gamedev","android_uri_scheme":"com.zerista.gamedev://","ios_url":"id2","ios_uri_scheme":null,"ios_store_country":"US","web_url":"https://gamedev.zerista.com","short_url_domain":null,"text_message":null,"og_app_id":null,"og_title":null,"og_image_url":null,"og_description":null}

According to RFC2396, uri schemes can have digits in them

http://stackoverflow.com/questions/3641722/valid-characters-for-uri-schemes
http://www.ietf.org/rfc/rfc2396.txt

We are using the android package name for our uri scheme and some of our android packages are of the form com.zerista.gamedev2015.

Would it be possible to support digits in the uri scheme?

Thank you.

Wrong bulk links generated

Hello.

I'm using your branch HTTP API and after 20 june 2016 I found strange bug:

links from bulk request (http://api.branch.io/v1/url/bulk/{key}) in api response stay wrong, such as http://{our_domain}/Vx6Hidkjru, and they not redirect to $fallback_url, which i'm writing into request.

Also checking this links with out api (https://api.branch.io/v1/url?url=) return me error 404 "The resource you were looking for could not be found."

Simple single request with the same parameters generate good links, which redirects correctly (such as http://{our_domain}/Y99d/yawPQnYhru).

Api docs, which i'm using, i found there: https://github.com/BranchMetrics/branch-deep-linking-public-api

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.