@@ -171,13 +171,13 @@ export class LinkedinProvider extends SocialAbstract implements SocialProvider {
171
171
172
172
const { elements } = await (
173
173
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 ] } ` ,
175
175
{
176
176
method : 'GET' ,
177
177
headers : {
178
178
'Content-Type' : 'application/json' ,
179
179
'X-Restli-Protocol-Version' : '2.0.0' ,
180
- 'LinkedIn-Version' : '202402 ' ,
180
+ 'LinkedIn-Version' : '202501 ' ,
181
181
Authorization : `Bearer ${ token } ` ,
182
182
} ,
183
183
}
@@ -203,15 +203,15 @@ export class LinkedinProvider extends SocialAbstract implements SocialProvider {
203
203
value : { uploadUrl, image, video, uploadInstructions, ...all } ,
204
204
} = await (
205
205
await this . fetch (
206
- `https://api.linkedin.com/rest /${
206
+ `https://api.linkedin.com/v2 /${
207
207
fileName . indexOf ( 'mp4' ) > - 1 ? 'videos' : 'images'
208
208
} ?action=initializeUpload`,
209
209
{
210
210
method : 'POST' ,
211
211
headers : {
212
212
'Content-Type' : 'application/json' ,
213
213
'X-Restli-Protocol-Version' : '2.0.0' ,
214
- 'LinkedIn-Version' : '202402 ' ,
214
+ 'LinkedIn-Version' : '202501 ' ,
215
215
Authorization : `Bearer ${ accessToken } ` ,
216
216
} ,
217
217
body : JSON . stringify ( {
@@ -242,7 +242,7 @@ export class LinkedinProvider extends SocialAbstract implements SocialProvider {
242
242
method : 'PUT' ,
243
243
headers : {
244
244
'X-Restli-Protocol-Version' : '2.0.0' ,
245
- 'LinkedIn-Version' : '202402 ' ,
245
+ 'LinkedIn-Version' : '202501 ' ,
246
246
Authorization : `Bearer ${ accessToken } ` ,
247
247
...( fileName . indexOf ( 'mp4' ) > - 1
248
248
? { 'Content-Type' : 'application/octet-stream' }
@@ -256,7 +256,7 @@ export class LinkedinProvider extends SocialAbstract implements SocialProvider {
256
256
257
257
if ( fileName . indexOf ( 'mp4' ) > - 1 ) {
258
258
const a = await this . fetch (
259
- 'https://api.linkedin.com/rest /videos?action=finalizeUpload' ,
259
+ 'https://api.linkedin.com/v2 /videos?action=finalizeUpload' ,
260
260
{
261
261
method : 'POST' ,
262
262
body : JSON . stringify ( {
@@ -268,7 +268,7 @@ export class LinkedinProvider extends SocialAbstract implements SocialProvider {
268
268
} ) ,
269
269
headers : {
270
270
'X-Restli-Protocol-Version' : '2.0.0' ,
271
- 'LinkedIn-Version' : '202402 ' ,
271
+ 'LinkedIn-Version' : '202501 ' ,
272
272
'Content-Type' : 'application/json' ,
273
273
Authorization : `Bearer ${ accessToken } ` ,
274
274
} ,
@@ -472,7 +472,7 @@ export class LinkedinProvider extends SocialAbstract implements SocialProvider {
472
472
isPersonal = true
473
473
) {
474
474
try {
475
- await this . fetch ( `https://api.linkedin.com/rest /posts` , {
475
+ await this . fetch ( `https://api.linkedin.com/v2 /posts` , {
476
476
body : JSON . stringify ( {
477
477
author :
478
478
( isPersonal ? 'urn:li:person:' : `urn:li:organization:` ) +
@@ -494,7 +494,7 @@ export class LinkedinProvider extends SocialAbstract implements SocialProvider {
494
494
headers : {
495
495
'X-Restli-Protocol-Version' : '2.0.0' ,
496
496
'Content-Type' : 'application/json' ,
497
- 'LinkedIn-Version' : '202402 ' ,
497
+ 'LinkedIn-Version' : '202501 ' ,
498
498
Authorization : `Bearer ${ integration . token } ` ,
499
499
} ,
500
500
} ) ;
0 commit comments