Skip to content

πŸ“¨ The ultimate agentic social media scheduling tool πŸ€–

feat: retry resource

Nevo David1c3cb008c67e
diff --git a/libraries/nestjs-libraries/src/integrations/social/linkedin.page.provider.ts b/libraries/nestjs-libraries/src/integrations/social/linkedin.page.provider.ts
index f60944d35..a8aed73aa 100644
--- a/libraries/nestjs-libraries/src/integrations/social/linkedin.page.provider.ts
+++ b/libraries/nestjs-libraries/src/integrations/social/linkedin.page.provider.ts
@@ -143,7 +143,7 @@ export class LinkedinPageProvider
headers: {
Authorization: `Bearer ${accessToken}`,
'X-Restli-Protocol-Version': '2.0.0',
- 'LinkedIn-Version': '202501',
+ 'LinkedIn-Version': '202601',
},
}
)
@@ -308,7 +308,7 @@ export class LinkedinPageProvider
{
headers: {
Authorization: `Bearer ${accessToken}`,
- 'Linkedin-Version': '202511',
+ 'Linkedin-Version': '202601',
'X-Restli-Protocol-Version': '2.0.0',
},
}
@@ -323,7 +323,7 @@ export class LinkedinPageProvider
{
headers: {
Authorization: `Bearer ${accessToken}`,
- 'Linkedin-Version': '202511',
+ 'Linkedin-Version': '202601',
'X-Restli-Protocol-Version': '2.0.0',
},
}
@@ -338,7 +338,7 @@ export class LinkedinPageProvider
{
headers: {
Authorization: `Bearer ${accessToken}`,
- 'Linkedin-Version': '202511',
+ 'Linkedin-Version': '202601',
'X-Restli-Protocol-Version': '2.0.0',
},
}
@@ -436,7 +436,7 @@ export class LinkedinPageProvider
await this.fetch(shareStatsUrl, {
headers: {
Authorization: `Bearer ${accessToken}`,
- 'LinkedIn-Version': '202511',
+ 'LinkedIn-Version': '202601',
'X-Restli-Protocol-Version': '2.0.0',
},
})
@@ -452,7 +452,7 @@ export class LinkedinPageProvider
await this.fetch(socialActionsUrl, {
headers: {
Authorization: `Bearer ${accessToken}`,
- 'LinkedIn-Version': '202511',
+ 'LinkedIn-Version': '202601',
'X-Restli-Protocol-Version': '2.0.0',
},
})
@@ -575,7 +575,7 @@ export class LinkedinPageProvider
headers: {
'X-Restli-Protocol-Version': '2.0.0',
'Content-Type': 'application/json',
- 'LinkedIn-Version': '202501',
+ 'LinkedIn-Version': '202601',
Authorization: `Bearer ${integration.token}`,
},
}
@@ -604,7 +604,7 @@ export class LinkedinPageProvider
headers: {
'X-Restli-Protocol-Version': '2.0.0',
'Content-Type': 'application/json',
- 'LinkedIn-Version': '202504',
+ 'LinkedIn-Version': '202601',
Authorization: `Bearer ${integration.token}`,
},
});
@@ -653,7 +653,7 @@ export class LinkedinPageProvider
headers: {
'X-Restli-Protocol-Version': '2.0.0',
'Content-Type': 'application/json',
- 'LinkedIn-Version': '202501',
+ 'LinkedIn-Version': '202601',
Authorization: `Bearer ${integration.token}`,
},
}
diff --git a/libraries/nestjs-libraries/src/integrations/social/linkedin.provider.ts b/libraries/nestjs-libraries/src/integrations/social/linkedin.provider.ts
index a0be34388..bbab352c0 100644
--- a/libraries/nestjs-libraries/src/integrations/social/linkedin.provider.ts
+++ b/libraries/nestjs-libraries/src/integrations/social/linkedin.provider.ts
@@ -53,6 +53,13 @@ export class LinkedinProvider extends SocialAbstract implements SocialProvider {
};
}
+ if (body.indexOf('resource is forbidden') > -1) {
+ return {
+ type: 'retry',
+ value: 'Resource is forbidden',
+ };
+ }
+
return undefined;
}
@@ -204,7 +211,7 @@ export class LinkedinProvider extends SocialAbstract implements SocialProvider {
headers: {
'Content-Type': 'application/json',
'X-Restli-Protocol-Version': '2.0.0',
- 'LinkedIn-Version': '202511',
+ 'LinkedIn-Version': '202601',
Authorization: `Bearer ${token}`,
},
}
@@ -249,7 +256,7 @@ export class LinkedinProvider extends SocialAbstract implements SocialProvider {
headers: {
'Content-Type': 'application/json',
'X-Restli-Protocol-Version': '2.0.0',
- 'LinkedIn-Version': '202511',
+ 'LinkedIn-Version': '202601',
Authorization: `Bearer ${accessToken}`,
},
body: JSON.stringify({
@@ -282,7 +289,7 @@ export class LinkedinProvider extends SocialAbstract implements SocialProvider {
method: 'PUT',
headers: {
'X-Restli-Protocol-Version': '2.0.0',
- 'LinkedIn-Version': '202511',
+ 'LinkedIn-Version': '202601',
Authorization: `Bearer ${accessToken}`,
...(isVideo
? { 'Content-Type': 'application/octet-stream' }
@@ -314,7 +321,7 @@ export class LinkedinProvider extends SocialAbstract implements SocialProvider {
}),
headers: {
'X-Restli-Protocol-Version': '2.0.0',
- 'LinkedIn-Version': '202511',
+ 'LinkedIn-Version': '202601',
'Content-Type': 'application/json',
Authorization: `Bearer ${accessToken}`,
},
@@ -573,7 +580,7 @@ export class LinkedinProvider extends SocialAbstract implements SocialProvider {
const response = await this.fetch(`https://api.linkedin.com/rest/posts`, {
method: 'POST',
headers: {
- 'LinkedIn-Version': '202511',
+ 'LinkedIn-Version': '202601',
'X-Restli-Protocol-Version': '2.0.0',
'Content-Type': 'application/json',
Authorization: `Bearer ${accessToken}`,
@@ -785,7 +792,7 @@ export class LinkedinProvider extends SocialAbstract implements SocialProvider {
headers: {
'X-Restli-Protocol-Version': '2.0.0',
'Content-Type': 'application/json',
- 'LinkedIn-Version': '202511',
+ 'LinkedIn-Version': '202601',
Authorization: `Bearer ${integration.token}`,
},
});
@@ -801,7 +808,7 @@ export class LinkedinProvider extends SocialAbstract implements SocialProvider {
headers: {
'X-Restli-Protocol-Version': '2.0.0',
'Content-Type': 'application/json',
- 'LinkedIn-Version': '202511',
+ 'LinkedIn-Version': '202601',
Authorization: `Bearer ${token}`,
},
}