Are projections no longer working for /posts in the LinkedIn API 202301 - linkedin

We are fetching all posts by author in the LinkedIn Rest API. We are using a projection to enrich the author with things like name and logo. Here is the query:
curl "https://api.linkedin.com/rest/posts?author={MY_ORG}&q=author&count=50&projection=(elements(*(*,author~(vanityName,localizedName,logoV2(*,cropped~:playableStreams(*,elements*(identifiers*(identifier))))))))" \
-H "LinkedIn-Version: 202212" \
-H "Authorization: .."
This works fine, however if I change to LinkedIn-Version: 202301 I get this response:
{
"status": 400,
"code": "ILLEGAL_ARGUMENT",
"message": "projection parameter is not allowed for this endpoint"
}
Is this documented anywhere? How do I get the author's details instead?

You could look at the returned author field and determine if it is of the format:
PersonURN: /^urn:li:person:[a-z0-9]+$/i
Organization urn: /^urn:li:organization:[0-9]+$/
For organizations use the organization lookup API You cannot use the organization endpoint for it.
For persons use the profile API

Related

Google Calendar update/patch API giving 403 error

I have a couple of resources added to my Gsuite and I am managing events of these resources from APIs.
Authentication & Authorization
I have generated oAuth creds , API key from the developer console. Provided necessary Scopes.
Resource Calendar emails are shared with my Calendar from settings & sharing option in Google Calendar.
SCOPES = ['https://www.googleapis.com/auth/calendar', 'https://www.googleapis.com/auth/calendar.events']
APIs
GET APIs are working fine but when I am trying to use update/patch APIs then it is giving me the error.
I also tried using the API explorer since this here scopes/tokens are handled by Google itself so it should work fine, but NO I am getting the same 403 error in API explorer too.
Interesting thing is if I pass the wrong body in Patchcall then it will give me 400 error but with the correct body it will give me 403.
Old SO questions Answer suggested to check Scopes, Share Resource Calendar in your Google Calendar, BUt I verified all these things and they are fine. I can verify the Granted scopes from token generated responses and even from the Account Settings Third APP page.
curl --location --request PATCH 'https://www.googleapis.com/calendar/v3/calendars/my_resource.calendar.google.com/events/<event_id>>' \
--header 'Authorization: Bearer <token>' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
"status": "cancelled"
}'
In above curl :
Token is of my gsuite user account > let's say user#custom_domain.com
calendarID is Gsuite Resource > my_resource.calendar.google.com
eventUId is > created from user#custom_domain.com and select my_resource.calendar.google.com as Room.
Thsi resource email my_resource.calendar.google.com is added in user#custom_domain.com Calendar. So user can manage events created on resource
But I am getting 403 error. Is there anything I am missing here in configuration ?
UPDATE
Error Message
{
"error": {
"errors": [
{
"domain": "global",
"reason": "forbidden",
"message": "Forbidden"
}
],
"code": 403,
"message": "Forbidden"
}
}

Linkedin POST Api - Get all posts

We have some problems with the new linkedin APi. (Posts) specifically with "Find Posts by Authors"
First:
We are not able to get all post.
Is only bringing some post and none of the last 6 months
Secondly: Is not bringing any value in pagination (is always empty).The only way we find to get another batch is changing the start parameter
Third:
The example is not working: this parameter 'X-Restli-Protocol-Version: 2.0.0' makes the api fail
curl -X GET 'https://api.linkedin.com/rest/posts?author={encoded organization urn like urn%3Ali%3Aorganization%32414183}&isDsc=false&q=author&count=10'
-H 'X-Restli-Protocol-Version: 2.0.0'
-H 'LinkedIn-Version: {version number in the format YYYYMM}'
-H 'X-RestLi-Method: FINDER'
-H 'Authorization: Bearer {INSERT_TOKEN}'
Can anyone give us some help, please?
Is anything we are doing weon
Thank you!
#linkedin
Documentation: https://learn.microsoft.com/en-us/linkedin/marketing/integrations/community-management/shares/posts-api?view=li-lms-2022-10&tabs=curl

Permission denied error creating a product set in google cloud vision product search

I am trying to create a product set on Google Cloud Vision Product Search, but I am getting a Permission denied error.
The Cloud Vision API is enabled in my project and the the service account key has Owner role. So, I do not know what is going on here.
Request:
curl -X POST -H "Authorization: Bearer $(gcloud auth application-default print-access-token)" -H "Content-Type: application/json; charset=utf-8" --data #./request.json "https://vision.googleapis.com/v1/projects/$PROJECT/locations/$LOCATION/productSets"
Error:
{
"error": {
"code": 403,
"message": "Permission denied.",
"status": "PERMISSION_DENIED"
Would you mind helping me on this?
Thanks
Eric
I already fixed this. My problem was the project ID. I was using an incorrect one.

In LinkedIn API v2.0, how to get company/list by person's token

In LinkedIn API v2.0, how to get company/list by person's token,the api of v1.0 is v1/companies:(id,name,logo-url)
As described in the LinkedIn Company Pages v1 to v2 API Migration Guide
, in the section List companies where member has a role, you can use the endpoint with the projection using the schema definition described here fro the mapping, as example:
curl -i -X GET \
-H "Authorization:Bearer <TOKEN>" \
'https://api.linkedin.com/v2/organizationalEntityAcls?q=roleAssignee&role=ADMINISTRATOR&projection=(elements*(organizationalTarget~(localizedName,vanityName,logoV2)))'
Hope this help

Unable to authorize dropbox api in wordrpess

Using the plugin, dropbox media importer in a wordpress app. I add the client key and secret after creating a personal dropbox app with full dropbox permission, I attempt to authorize the request but it returns an error that says invalided client_id or secret. When I try to do the curl request with the client_id & secret I get the same response.
Request:
curl -X POST https://api.dropboxapi.com/2/auth/token/from_oauth1 \
--header "Authorization: Basic <REDACTED>" \
--header "Content-Type: application/json" \
--data "{\"oauth1_token\": \"qievr8hamyg6ndck\",\"oauth1_token_secret\": \"qomoftv0472git7\"}"
Response:
{"error_summary": "invalid_oauth1_token_info/", "error": {".tag": "invalid_oauth1_token_info"}
The /2/auth/token/from_oauth1 endpoint you're attempting to use is only for exchanging existing OAuth 1 access tokens (e.g., as previously retrieved for use with the now-retired Dropbox API v1) for OAuth 2 access tokens.
If you're just integrating now, you wouldn't have any OAuth 1 access tokens, and so shouldn't be using this endpoint. (Accordingly, it's indicating that the oauth1_token and oauth1_token_secret values you're supplying are incorrect; the ones you're using are just copied from the documentation, but you would need to supply your real values.)
Instead, you should implement the Dropbox OAuth 2 app authorization flow. You can find more information in the documentation and guide.

Resources