Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade headers to versioned API 202208 #61

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alexander-zierhut
Copy link

@alexander-zierhut alexander-zierhut commented Jan 3, 2023

The Linkedin API now uses versioning and will deprecate the legacy version on Feb, 28.

I have migrated using setApiHeaders, but so not everyone has to read up on this themselves, I am creating this PR.

What I have tested already:

  • Create a posts
  • Upload assets
  • Login with Linkedin
  • Read profile / group data

Some more testing for deprecations might be needed.

Sources:
https://www.linkedin.com/developers/news/featured-updates/versioning-content-launch
https://learn.microsoft.com/en-us/linkedin/marketing/versioning

For everyone else reading this:

// Change the API endpoint to the new versioned endpoint
$this->client->setApiRoot("https://api.linkedin.com/rest/");

// Set the API headers to use the new versioning
$this->client->setApiHeaders([
    'Content-Type' => 'application/json',
    'x-li-format' => 'json',
    "LinkedIn-Version" => "202208",
]);```

@sammyaxe
Copy link

sammyaxe commented Nov 8, 2023

Will this get merged?

@sammyaxe
Copy link

sammyaxe commented Nov 8, 2023

@alexander-zierhut feel free to open PR here https://github.com/sammyaxe/linkedin-api-php-client, will make you maintainer aswell

@alexander-zierhut
Copy link
Author

alexander-zierhut commented Nov 9, 2023

@sammyaxe Sure, will do. I guess you used my workaround as well? This repo has become kind of stale. I'd also like a new version which at least still upgrades it's dependencies. If you are serious about this, I'll be switching our projects to this as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants