How can I get custom_array from Brach.io deep-links? - http

I have an e-commerce application and I want to share my item/cart to other users. For sharing, I am using Branch.io for creating deep-links. I am appending some custom data while creating the URL and send it to other users. Otherwise, I will keep the URL in my database for future use. Sometimes I am not able to get the data from the URL once it's created or after some days. As per the documentation of branch.io, there is no expiration for the URL. The following API I am using for creating a deep-link:
POST /v1/url HTTP/1.1
Host: api2.branch.io
Content-Type: application/json
{
"branch_key": "xxxxxxxxxxxxxxxxxxseaem3d",
"data": {
"custom_array": [
{
"item_id": "5e96f893264b7869d143f7f2",
"store_id": "5e7355deb1f5974bbd0bab18",
"items_group_id": "5e7355deb1f5974bbd0brer18"
}
]
}
}
Response:
{
"url": "https://jazzly.app.link/YDPMzhg1k7"
}
We can able to check the data is available in the URL or not using the following API.
GET /v1/url?url=https://jazzly.app.link/YDPMzhg1k7&branch_key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxseaem3d
HTTP/1.1
Host: api2.branch.io
By using this API I am getting the following result. Here the custom_array is missing.
{
"data": {
"+url": "https://jazzly.app.link/YDPMzhg1k7",
"~creation_source": 0,
"~id": "801058500452495196",
"$one_time_use": false,
"url": "https://jazzly.app.link/YDPMzhg1k7"
},
"type": 0
}
This issue comes with only some links. Some links are working properly some links are not. Actually it's very helpful for dynamically open the application for IOS and Android. How I can fix this issue? Is there any parameter is missing while I am creating the deep-link URL or is there an expiration time for keeping custom data in the deep-link?

A Branchster here -
Upon checking your link https://jazzly.app.link/YDPMzhg1k7, I couldn't find any custom data associated.
To reproduce this we made API requests with your custom data and got the following link - https://jazzly.app.link/cLX6GEFk07. Further, we could read the associated link data as well -
We would suggest you recheck on the same behaviour and if the issue still persists drop an email to support#branch.io

Related

Issues while expanding URNs in versioned creatives response

We are migrating our APIs from unversioned to versioned, and having an issue while trying to get assets data from creatives endpoint.The response has reference to a post, but we are unable to use the expand URNs concept and get the inner media details of the Post URN. Is there a different approach we need to follow here?
I've read through all the migration documents and the response decoration document is also pointing to v2 endpoint and projection parameters, instead of using rest endpoint and fields parameter. Document reference.
Previous Request
GET -
https://api.linkedin.com/v2/adCreativesV2?ids[0]=181794673&projection=(results(*(variables(data(com.linkedin.ads.SponsoredVideoCreativeVariables(userGeneratedContentPost~(specificContent(com.linkedin.ugc.ShareContent(shareCommentary,media(*(media~:playableStreams(),title)))))))))))
This request gets us the media details of the creatives without making multiple calls.
Current Request
GET - https://api.linkedin.com/rest/creatives?ids=List(urn%3Ali%3AsponsoredCreative%3A181794673)&fields=(results(*(content(reference~($URN)))))
I am looking at the response I got from https://api.linkedin.com/rest/creatives?ids=List(urn%3Ali%3AsponsoredCreative%3A181794673) and trying to create the fields request. But no luck yet and getting the below error.
{
"status": 400,
"code": "ILLEGAL_ARGUMENT",
"message": "Invalid projection parameter: (results(*(content(reference~($URN)))))"
}
But when tried with projection in place of fields I got a response
{
"results": {
"urn:li:sponsoredCreative:181794673": {
"content": {
"reference": "urn:li:ugcPost:6905584391779950593",
"reference!": {
"message": "Not enough permissions to access deco: ugcPosts.BATCH_GET.20230101",
"status": 403
}
}
}
}
}
Can someone help me getting the data similar to how we got it before, without making external calls? Otherwise I think I have to be making calls to Creatives -> Posts -> Video, Image, Share etc endpoints

Always get “Cannot parse non Measurement Protocol hits”

I have a little Python program that other people use and I would like to offer opt-in telemetry such that can get an idea of the usage patterns. Google Analytics 4 with the Measurement Protocol seems to be the thing that I want to use. I have created a new property and a new data stream.
I have tried to validate the request and set it to www.google-analytics.com/debug/mp/collect?measurement_id=G-LQDLGRLGZS&api_secret=JXGZ_CyvTt29ucNi9y0DkA via post and send this JSON payload:
{
"app_instance_id": "MyAppId",
"client_id": "TestClient.xx",
"events": [
{
"name": "login",
"params": {}
}
]
}
The response that I get is this:
{
"validationMessages": [
{
"description": "Cannot parse non Measurement Protocol hits.",
"validationCode": "INTERNAL_ERROR"
}
]
}
I seem to be doing exactly what they do in the documentation or tutorials. I must be doing something wrong, but I don't know, what is missing. What do I have to do in order to successfully validate the request?
Try to remove /debug part in the URL. In the example you followed it is not present so it is not quite exactly the same.
we just came across the same issue and the solution for us was to put https:// in front of the URL. Hope this helps.

HERE LinkId from route not found in PDE (Platform Data Extension)

UPDATE: It's happening again, also with Fleet API. Please see additional examples at end of the post.
I'm using HERE's REST API to calculate a route, then ask for additional data for each link / route segment by querying HERE's Platform Data Extension (PDE). This usually works fine, but now I've run into a link id that is not recognised by PDE.
Are these services not in sync, or am I doing something wrong?
I didn't have any issue in the past weeks, and it still works fine for most link ids, so this could either be a new problem or a very singular issue. I searched in the HERE API documentation and on Stackoverflow, but couldn't find anything related.
Route request (A24 Berlin towards Hamburg): https://route.api.here.com/routing/7.2/calculateroute.json?waypoint0=geo!52.7091,13.0356&waypoint1=geo!52.7193,12.9608&mode=fastest;car;traffic:disabled&representation=navigation&app_id=xxx&app_code=yyy
The json response (below) contains a link with permanent id 1199057935 at Anschlussstelle Kremmen.
The PDE request gives an empty response: https://pde.api.here.com/1/index.json?layer=ROAD_GEOM_FCn&attributes=LINK_ID&values=1199057935&app_id=xxx&app_code=yyy
{"Layers":[]}
Instead, I would expect the data of the containing tile, e.g. what I get for 1199057936
{"Layers":[{"layer":"ROAD_GEOM_FC1","level":9,"tileXYs":[{"x":548,"y":405}]}]}
I also tried the PDE request with ROAD_GEOM_FC1 and prefixing the id with + (values=+1199057935). Other link ids of the route return the expected tile information.
For completeness, here's the link's json from the routing response:
{
"linkId":"+1199057935",
"shape":["52.7175629,12.976613","52.7177131,12.9749393"],
"firstPoint":28,
"lastPoint":29,
"length":114,
"remainDistance":1095,
"remainTime":39,
"nextLink":"+1199057936",
"maneuver":"M2",
"speedLimit":33.3333359,
"dynamicSpeedInfo":{"trafficSpeed":16.3888893,"trafficTime":7,"baseSpeed":27.5,"baseTime":4,"jamFactor":5.7118645},
"flags":["motorway"],
"functionalClass":1,
"roadNumber":"A24",
"timezone":"+0100",
"roadName":"",
"consumption":0,
"_type":"PrivateTransportLinkType"
}
UPDATE 2019-05-27:
I get a route that contains link id 1239826684 from https://route.api.here.com/routing/7.2/calculateroute.json?waypoint0=geo!52.5066,13.4299&waypoint1=geo!52.5282,13.4265&mode=fastest;car;traffic:disabled&representation=navigation&app_id=xxx&app_code=yyy
Using fleet endpoint redirects to same call as above, including link id 1239826684: https://fleet.api.here.com/2/calculateroute.json?waypoint0=geo!52.5066,13.4299&waypoint1=geo!52.5282,13.4265&mode=fastest;car;traffic:disabled&representation=navigation&app_id=xxx&app_code=yyy
PDE returns [] for that link id: https://pde.api.here.com/1/index.json?layer=ROAD_GEOM_FCn&attributes=LINK_ID&values=1239826684&app_id=xxx&app_code=yyy
Fleet API returns [] for that link id: http://fleet.cit.api.here.com/1/index.json?layer=ROAD_GEOM_FCn&attributes=LINK_ID&values=1239826684&app_id=xxx&app_code=yyy
Seems the underlying geo-data is not in sync, and using different APIs does not help. Any other solution?
You can try Fleet telematics group of API's over basic routing and PDE as Fleet Telematics provides whole routing solution .
Please find the below API request which is giving expected response for the id-1199057935
http://fleet.cit.api.here.com/1/index.json?layer=ROAD_GEOM_FCn&attributes=LINK_ID&values=1199057935&app_id=xxxx&app_code=yyyy
Response :
{
Layers: [
{
layer: "ROAD_GEOM_FC1",
level: 9,
tileXYs: [
{
x: 548,
y: 405
}
]
}
]
}
for more information kindly go through the below documentation
https://developer.here.com/documentation/fleet-telematics/api-reference.html#operation%2FindexJSONUsingGET
Hope this will help.

Filepicker.io: Pagespeed and remove query strings from static resources

So after successful upload of images via Filepicker we access the images at the given URL and in most places call convert with some parameters passed in. We use Amazon S3 Cloudfront as a CDN in front of filepicker as filepicker states convert is not meant for high traffic sites - fair enough.
The problem that I'm experiencing with convert though is that it's nailing our Page speed and we are getting the message "remove query strings from static resources" for all our Filepicker files.
The reason for the warning is "Resources with a "?" in the URL are not cached by some proxy caching servers."
Is there a way to avoid using query parameters while still retaining the capability of convert function?
I would love to improve my pagespeed but can't see how to fix this particular issue while still using Filepicker.
Similar to REST convert there is javascript filepicker.convert method which return new file link.
var blob = {
url: 'https://www.filepicker.io/api/file/H7KYuWy1S3e1qvG2M66i',
filename: 'customers.jpg',
mimetype: 'image/jpeg',
isWriteable: false,
size: 629454
};
filepicker.convert(
blob,
{
width: 200,
height: 200
},
function(converted_Blob){
console.log(converted_Blob.url);
}
);
Another solution would be to store the conversion REST results.
Curl example:
curl -X POST -d url="https://www.filepicker.io/api/file/H7KYuWy1S3e1qvG2M66i/convert?w=100" "https://www.filepicker.io/api/store/S3?key=yourApiKey&container=yourContainerName"
Sample response:
{"container": "yourContainerName", "url": "https://www.filepicker.io/api/file/383MY1piRQqTg1N9K5tw", "filename": "IMAG0038.jpg", "key": "XNeqfiMaRlm4OMAQIJ9y_IMAG0038.jpg", "type": "image/jpeg", "size": 1763}
In this way you can create a server-side conversions

FB Graph API - Invalid id: 0 when requesting news feed. Profile feed, friends do work

I'm using ASP.NET / c# to get the news feed of a facebook user. But since today my request for the user's news feed is returning an 500 error. (Internal server error)
Here is what i'm trying to do:
s
tring jsonUrl = graphUrl + "/" + id + "/home?access_token=" + token;
var json = new WebClient().DownloadString(jsonUrl);
When i copy paste the jsonurl in my browser i get the following result:
"error": {
"type": "IDInvalidException",
"message": "Invalid id: 0"
}
If i change "home" to "feed" or "friends", then i do get the result i want. Is there something wrong here?
I hope someone can help me here.
Add "read_stream" to the list of your permissions.
This was working before without adding that flag to your permissions session but now seems they require to specify that.
I was having the same issue in a iOS Application but now is working again

Resources