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
Related
We are developing an internal project to use the Windchill OData REST API to fill the eBOM for a given part. What we are trying to do here is to read data from another software we have to get the BOM info and send it to the part in windchill. But we cannot find an endpoint in servlet/odata to do it.
We guess the idea is to replicate the manual process. So we already know how to create, check out and check in a part. However we still cannot find an endpoint to modify the part and add the eBOM.
We know PartList, PartListItem, GetPartStructure in the PTC Product Management Domain. But these are GET endpoints and are only useful to retrieve data, including the BOM. But we cannot use them to modify the content.
I've found the solution.
The endpoint to use is:
POST /ProdMgmt/Parts('VR:wt.part.WTPart:xxxxxxxxx')/Uses
The body of the request must contain:
{
"Quantity": 1,
"Unit": {
"Value": "ea",
"Display": "Each"
},
"TraceCode": {
"Value": "0",
"Display": "Untraced"
},
"Uses#odata.bind": "Parts('OR:wt.part.WTPart:yyyyyyyyy')"
}
Where Uses#odata.bind contains the ID of the part we want to link
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.
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
When I calculate the route from coordinate 49.4935,0.5118 to 41.8114,2.7408 (truck + trailer 40ton) the web service returns error 400 - Bad request.
I have tested this with the example https://tcs.ext.here.com/examples/v3/fleet_telematics_api, and this explains the reason: the second waypoint is in a zone with a restriction of 7.5 ton (see image).
Is there a possibility to get this error from the webservice, so I can alert the user what the problem is?
Here example
When you make your request, you get this response:
{
"issues": [
{
"message": "Couldn't reach way point 1 (start links 907492075 -907492075 907492077 -907492077 907493126 -907493126 dest links 719515104 -719515104 ), link 907492075 might restrict access for the vehicle type, link 907492075's through traffic restriction might apply, link 907492077 might restrict access for the vehicle type, link 907492077's through traffic restriction might apply, link 907493126's through traffic restriction might apply"
},
{
"message": "Request id: bfb4932d-f159-4d3a-986e-77f6bc41b143"
}
],
"response": null,
"error_id": "bfb4932d-f159-4d3a-986e-77f6bc41b143",
"response_code": "400 Bad Request"
}
The response code is 400 Bad Request but there is also a list of messages in issues that you can use to alert the user.
I am trying to create a API/Lambda process which takes a comment and posts in into my RDS Aurora database.
The comment field in the database is set as TEXT type
The lambda function posts the comment to the database
The API method is POST
A mapping template has been set u to map the request body into the lambda function
All work perfectly until I start to try and post large comments. (A large paragraph, maybe 500 characters)
The body looks as follows:
{
"comment":"long comment"
}
When I run it in Lambda, I can post massive comments, however when I try and do it through the API Gateway I get an error
Endpoint response body before transformations: {"stackTrace": [["/var/task/app.py", 38, "handler", "raise Exception('Internal Error: Unable to post the comment.')"]], "errorType": "Exception", "errorMessage": "Internal Error: Unable to post the comment."}
I would suggest to use the test invoke feature on API Gateway console. From there, you can see the payload before transformed and after transformed. That might be a bit on debugging.