Branch.io event logging - branch.io

I am following the below link for logging ecommerce event in branch.io
https://github.com/BranchMetrics/branch-deep-linking-public-api#logging-commerce-events
I am using the same request as mentioned in the link.
but the details are not getting captured in branch.io dashboard.
I am getting "branch_view_enabled": false as a response.
Please help me out if there is any issue in settings ? or explicitly I will have to do something for seeing the events in the dashboard.
A response will be highly appreciated!

I tried it like this
new BranchEvent("Event Name")
.addCustomDataProperty("Key", "Value")
.logEvent(this);
And it shows the event name on the branch dashboard under summary. And my log shows that internally it was targeting the v2. I am sending it through android
https://api.branch.io/v2/event/custom

This is Jackie from Branch.
We are not yet supporting v2/events for commerce yet which is why you weren't able to track it on the dashboard.
Moving forward, please use v1 event request following our official documentation here. I've also included a sample commerce request for your information. In the meantime, we will update the commerce information on our github page so as not to cause any confusion.
curl -X POST https://api.branch.io/v1/event \
-d '{
"branch_key": "your_Branch_key",
"identity": "222",
"event": "purchase",
"metadata": {
"hello": "world",
"custom_data": "this"
},
"commerce_data": {
"revenue": 50.0,
"currency": "USD",
"transaction_id": "foo-transaction-id",
"shipping": 0.0,
"tax": 5.0,
"affiliation": "foo-affiliation",
"products": [
{
"sku": "foo-sku-1",
"name": "foo-item-1",
"price": 45.00,
"quantity": 1,
"brand": "foo-brand",
"category": "Electronics",
"variant": "foo-variant-1"
},
{
"sku": "foo-sku-2",
"price": 2.50,
"quantity": 2
}
]
}
}'
Hope this helps. Please feel free to contact us directly if you have any other questions or issues at support#branch.io.
Best,
Jackie

Related

Can we enable Save Card option with Pay By Link [POST] method

I'm working on Global Payments system and trying to achieve Pay By Link http post method to generate the link and share with customer to pay at their convenient time. In the sandbox url below request body is working fine.
{
"SHA1HASH": "606ab12bb09f5e68b1d72ce26622650d485583fd",
"TIMESTAMP": "20210612042252",
"MERCHANT_ID": "somehotel",
"ACCOUNT": "internet",
"ORDER_ID": "5ef1c1ce6da546069998744bdce3d8c9",
"AMOUNT": "2000",
"CURRENCY": "EUR",
"AUTO_SETTLE_FLAG": "1",
"COMMENT1": "Email Channel",
"HPP_VERSION": "2",
"HPP_LANG": "en",
"HPP_CUSTOMER_EMAIL": "somebody#gmail.com",
"HPP_CUSTOMER_PHONENUMBER_MOBILE": "91|9999999999",
"HPP_BILLING_STREET1": "Flat 123",
"HPP_BILLING_STREET2": "House 456",
"HPP_BILLING_STREET3": "Unit 4",
"HPP_BILLING_CITY": "Halifax",
"HPP_BILLING_POSTALCODE": "W5 9HR",
"HPP_BILLING_COUNTRY": "826",
"HPP_SHIPPING_STREET1": "Apartment 852",
"HPP_SHIPPING_STREET2": "Complex 741",
"HPP_SHIPPING_STREET3": "House 963",
"HPP_SHIPPING_CITY": "Chicago",
"HPP_SHIPPING_STATE": "IL",
"HPP_SHIPPING_POSTALCODE": "50001",
"HPP_SHIPPING_COUNTRY": "840",
"HPP_ADDRESS_MATCH_INDICATOR": "FALSE",
"HPP_CHALLENGE_REQUEST_INDICATOR": "NO_PREFERENCE",
"BILLING_CODE": "59|123",
"BILLING_CO": "GB",
"SHIPPING_CODE": "50001|Apartment 852",
"SHIPPING_CO": "US",
"CUST_NUM": "6e027928-c477-4689-a45f-4e138a1f208a",
"VAR_REF": "Acme Corporation",
"PROD_ID": "SKU1000054",
"MERCHANT_RESPONSE_URL": "https://www.example.com/responseUrl",
"SUPPLEMENTARY_DATA": "Custom Value"
}
Is there a way to enable Save Card option. I tried providing the below flags as seen on another payment reference, but the response started giving hash error.
Request Body included below
"CARD_STORAGE_ENABLE": "1",
"OFFER_SAVE_CARD": "1",
"PAYER_EXIST": "0",
"PAYER_REF": "376a2598-412d-4805-9f47-c177d5605853",
"PMT_REF": "ca46344d-4292-47dc-9ced-e8a42ce66977",
And the response from server
{
"resultCode":508,
"internalErrorCode":61000,
"errorMessage":"Incorrect hash. Please check your code and the Developers Documentation."
}
Is this a restriction by purpose or are we passing wrong flags? Please help!
These are the two sections from the developer portal describing how to generate the hash:
Card Payments: https://developer.globalpay.com/hpp/card-payments#generate-hash
Card Storage: https://developer.globalpay.com/hpp/card-storage#generate-hash

How can I add product to shopify store from another website?

I want add products to Shopify store form another website (maybe) using API. I not finding the request URL for do it. Please help me make it. I Writing this website with PHP (Laravel framework)
To create new product you can use the Product REST API
Example:
POST /admin/api/2020-07/products.json
{
"product": {
"title": "Burton Custom Freestyle 151",
"body_html": "<strong>Good snowboard!</strong>",
"vendor": "Burton",
"product_type": "Snowboard",
"metafields": [
{
"key": "new",
"value": "newvalue",
"value_type": "string",
"namespace": "global"
}
]
}
}
Pay attention that for such type operation you will need to have the write_products scope

How to build url to yelp review using yelp API?

How to build url to yelp review using yelp API?
"reviews": [
{
"excerpt": "This is by far my favorite breakfast food. They have the best plain grits and one of the best omelets I\u0027ve ever had. The grits require no extra seasoning,...",
"id": "N95_f0ssLhVk-3_adcm0HA",
"rating": 5.0,
"rating_image_large_url": "https://s3-media3.fl.yelpcdn.com/assets/2/www/img/22affc4e6c38/ico/stars/v1/stars_large_5.png",
"rating_image_small_url": "https://s3-media1.fl.yelpcdn.com/assets/2/www/img/c7623205d5cd/ico/stars/v1/stars_small_5.png",
"rating_image_url": "https://s3-media1.fl.yelpcdn.com/assets/2/www/img/f1def11e4e79/ico/stars/v1/stars_5.png",
"time_created": 1.456714839E9,
"user": {
"id": "v6q8B9nEHBK25EuNIUF09g",
"image_url": "http://s3-media4.fl.yelpcdn.com/photo/zzXwod9kRw5BC-OZn2S6Dg/ms.jpg",
"name": "Ashley M."
}
}
I can see the review information here, but I can't see link to the review to do smth like "read more". Can someone help me with it?
The solution will be smth like that:
url.substring(0, url.indexOf("?")) + "?hrid=" + reviewId;

Is there any work around on fetching twitter conversations using latest Twitter REST API v1.1

I am working on a project where the conversation of a twitter user needs to be retrieved. For example i want to get all the replies of this tweet of BBC World Service. Using the REST API v1.1 i can get the timeline (tweet, re-tweet) of a twitter user. But i did not find any documentation/working work around on fetching replies of a specific tweet. Is there any work around on getting the replies of a specific tweet at all?
There is no API call to get replies to a specific tweet. You can, however, cheat!
Using the Search API you can construct a search query which is:
In reply to #bbcworldservice.
Occurred after the tweet was posted.
Optionally, before a specific date / time.
So, in this case, something like
https://api.twitter.com/1.1/search/tweets.json?
q=%23bbcworldservice&
since_id=489366839953489920&
count=100
You'll get a list of Tweets (up to 100). You will then need to search them for in_reply_to_status_id_str and see if it matches the status you're looking for.
The TwitterAPI v2 allows you to retrieve the entire conversation thread using just the conversation_id in search. (In v1.1 you had to write custom code to build it)
Replies to a given Tweet, as well as replies to those replies, are all included in the conversation stemming from the single original Tweet. Regardless of how many reply threads result, they will all share a common conversation_id to the original Tweet that sparked the conversation. Using the Twitter API v2, you have the ability to retrieve and reconstruct an entire conversation thread, so that you can better understand what is being said, and how conversations and ideas evolve.
Example:
curl --request GET \
--url 'https://api.twitter.com/2/tweets?ids=1225917697675886593&tweet.fields=author_id,conversation_id,created_at,in_reply_to_user_id,referenced_tweets&expansions=author_id,in_reply_to_user_id,referenced_tweets.id&user.fields=name,username' \
--header 'Authorization: Bearer $BEARER_TOKEN'
Response will be like
{
"data": [
{
"id": "1225917697675886593",
"text": "#TwitterEng",
"created_at": "2020-02-07T23:02:10.000Z",
"author_id": "2244994945",
"in_reply_to_user_id": "6844292",
"conversation_id": "1225912275971657728",
"referenced_tweets": [
{
"type": "quoted",
"id": "1200517737669378053"
},
{
"type": "replied_to",
"id": "1225912275971657728"
}
]
}
],
"includes": {
"users": [
{
"username": "TwitterDev",
"name": "Twitter Dev",
"id": "2244994945"
},
{
"username": "TwitterEng",
"name": "Twitter Engineering",
"id": "6844292"
}
],
"tweets": [
{
"id": "1200517737669378053",
"text": "| ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄|\n don't push \n to prod on \n Fridays \n|___________| \n(\\__/) ||\n(•ㅅ•) ||\n/   づ",
"created_at": "2019-11-29T20:51:47.000Z",
"author_id": "2244994945",
"conversation_id": "1200517737669378053"
},
{
"id": "1225912275971657728",
"text": "Note to self: Don't deploy on Fridays",
"created_at": "2020-02-07T22:40:37.000Z",
"author_id": "6844292",
"conversation_id": "1225912275971657728"
}
]
}
}
For more info checkout twitter API Conversation

Pinterest board list

I am looking for a way to get the list of board names from a given username. I know pinterest already provides rss for all the pins from a given user and for all the pins from a given pinboard.
All Pins from a given user: pinterest.com/[user]/feed.rss
All pins from a given user and board: pinterest.com/[user]/[board-name]/rss
Now I need a way to get the list of boards from a given user, not the pins. I know there is a way to do it because -> pinreach.com does it.
Thank you in advance :)
RSS feed only has 25 pins. To get boards or all the pins, you have to crawl the site. There is no way around it.
Here is another Unofficial API with Documentation for Pintrest
http://pinterestapi.co.uk/
Hey you can check out this unofficial Pinterest API, you can search boards by username - https://www.mashape.com/ismaelc/pinterest-1#endpoint-Show-User-Boards
Sample result below:
{
"body": [
{
"name": "Books Worth Reading",
"href": "http://pinterest.com/ismael/books-worth-reading/",
"num_of_pins": 6,
"cover_src": "http://media-cache-ec7.pinterest.com/222x/0c/31/22/0c3122735319edbf9b8aae28c9b22f86.jpg",
"thumbs_src": [
"http://media-cache-ec6.pinterest.com/75x75/2a/2d/7b/2a2d7b6f20f7518269b310b25d876810.jpg",
"http://media-cache-ec4.pinterest.com/75x75/e6/05/05/e6050519c5686ae27ad649500965f39c.jpg",
"http://media-cache-ec5.pinterest.com/75x75/07/64/c3/0764c392bae2b073c4c862a6503f09d6.jpg",
"http://media-cache-ec4.pinterest.com/75x75/61/35/0a/61350ab6eb4bb0b0d09f7c191bf30d55.jpg"
]
},
{
"name": "My Style",
"href": "http://pinterest.com/ismael/my-style/",
"num_of_pins": 0,
"cover_src": false,
"thumbs_src": false
},
{
"name": "For the Home",
"href": "http://pinterest.com/ismael/for-the-home/",
"num_of_pins": 0,
"cover_src": false,
"thumbs_src": false
},
{
"name": "Favorite Places & Spaces",
"href": "http://pinterest.com/ismael/favorite-places-spaces/",
"num_of_pins": 0,
"cover_src": false,
"thumbs_src": false
}
],
"meta": {
"count": 4
}
}
You can do this now using the Official Pinterest API using the hook:
https://api.pinterest.com/v1/me/boards/?access_token=********&fields=id%2Cname%2Curl
First, you will need to authenticate and get an acce3ss token.
The getting started doc do a good job at explaining how. https://developers.pinterest.com/docs/api/overview/