@@ -171,13 +171,13 @@ export class LinkedinProvider extends SocialAbstract implements SocialProvider {
171171
172172 const { elements } = await (
173173 await this . fetch (
174- `https://api.linkedin.com/rest /organizations?q=vanityName&vanityName=${ getCompanyVanity [ 1 ] } ` ,
174+ `https://api.linkedin.com/v2 /organizations?q=vanityName&vanityName=${ getCompanyVanity [ 1 ] } ` ,
175175 {
176176 method : 'GET' ,
177177 headers : {
178178 'Content-Type' : 'application/json' ,
179179 'X-Restli-Protocol-Version' : '2.0.0' ,
180- 'LinkedIn-Version' : '202402 ' ,
180+ 'LinkedIn-Version' : '202501 ' ,
181181 Authorization : `Bearer ${ token } ` ,
182182 } ,
183183 }
@@ -203,15 +203,15 @@ export class LinkedinProvider extends SocialAbstract implements SocialProvider {
203203 value : { uploadUrl, image, video, uploadInstructions, ...all } ,
204204 } = await (
205205 await this . fetch (
206- `https://api.linkedin.com/rest /${
206+ `https://api.linkedin.com/v2 /${
207207 fileName . indexOf ( 'mp4' ) > - 1 ? 'videos' : 'images'
208208 } ?action=initializeUpload`,
209209 {
210210 method : 'POST' ,
211211 headers : {
212212 'Content-Type' : 'application/json' ,
213213 'X-Restli-Protocol-Version' : '2.0.0' ,
214- 'LinkedIn-Version' : '202402 ' ,
214+ 'LinkedIn-Version' : '202501 ' ,
215215 Authorization : `Bearer ${ accessToken } ` ,
216216 } ,
217217 body : JSON . stringify ( {
@@ -242,7 +242,7 @@ export class LinkedinProvider extends SocialAbstract implements SocialProvider {
242242 method : 'PUT' ,
243243 headers : {
244244 'X-Restli-Protocol-Version' : '2.0.0' ,
245- 'LinkedIn-Version' : '202402 ' ,
245+ 'LinkedIn-Version' : '202501 ' ,
246246 Authorization : `Bearer ${ accessToken } ` ,
247247 ...( fileName . indexOf ( 'mp4' ) > - 1
248248 ? { 'Content-Type' : 'application/octet-stream' }
@@ -256,7 +256,7 @@ export class LinkedinProvider extends SocialAbstract implements SocialProvider {
256256
257257 if ( fileName . indexOf ( 'mp4' ) > - 1 ) {
258258 const a = await this . fetch (
259- 'https://api.linkedin.com/rest /videos?action=finalizeUpload' ,
259+ 'https://api.linkedin.com/v2 /videos?action=finalizeUpload' ,
260260 {
261261 method : 'POST' ,
262262 body : JSON . stringify ( {
@@ -268,7 +268,7 @@ export class LinkedinProvider extends SocialAbstract implements SocialProvider {
268268 } ) ,
269269 headers : {
270270 'X-Restli-Protocol-Version' : '2.0.0' ,
271- 'LinkedIn-Version' : '202402 ' ,
271+ 'LinkedIn-Version' : '202501 ' ,
272272 'Content-Type' : 'application/json' ,
273273 Authorization : `Bearer ${ accessToken } ` ,
274274 } ,
@@ -472,7 +472,7 @@ export class LinkedinProvider extends SocialAbstract implements SocialProvider {
472472 isPersonal = true
473473 ) {
474474 try {
475- await this . fetch ( `https://api.linkedin.com/rest /posts` , {
475+ await this . fetch ( `https://api.linkedin.com/v2 /posts` , {
476476 body : JSON . stringify ( {
477477 author :
478478 ( isPersonal ? 'urn:li:person:' : `urn:li:organization:` ) +
@@ -494,7 +494,7 @@ export class LinkedinProvider extends SocialAbstract implements SocialProvider {
494494 headers : {
495495 'X-Restli-Protocol-Version' : '2.0.0' ,
496496 'Content-Type' : 'application/json' ,
497- 'LinkedIn-Version' : '202402 ' ,
497+ 'LinkedIn-Version' : '202501 ' ,
498498 Authorization : `Bearer ${ integration . token } ` ,
499499 } ,
500500 } ) ;
0 commit comments