Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import linkedin from "../../linkedin.app.mjs";
export default {
key: "linkedin-get-member-organization-access-control",
name: "Get Member's Organization Access Control Information",
description: "Gets the organization access control information of the current authenticated member. [See the docs here](https://docs.microsoft.com/en-us/linkedin/marketing/integrations/community-management/organizations/organization-access-control?context=linkedin/compliance/context#find-a-members-organization-access-control-information)",
version: "0.1.6",
description: "Gets the organization access control information of the current authenticated member. [See the documentation](https://learn.microsoft.com/en-us/linkedin/marketing/community-management/organizations/organization-access-control-by-role?view=li-lms-2025-01&tabs=http#find-a-members-organization-access-control-information)",
version: "1.0.0",
type: "action",
props: {
linkedin,
Expand All @@ -28,32 +28,21 @@ export default {
},
},
async run({ $ }) {
const count = 50;
const results = [];

const params = {
q: "roleAssignee",
role: this.role,
state: this.state,
start: 0,
count,
count: 1,
};

let done = false;
do {
const { elements } = await this.linkedin.getAccessControl({
$,
params,
});
results.push(...elements);
params.start += count;
if (elements?.length < count) {
done = true;
}
} while (results.length < this.max && !done);
const { data: { elements } } = await this.linkedin.getAccessControl({
$,
params,
});

$.export("$summary", "Successfully retrieved access control information");

return results;
return elements[0];
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,17 @@ import linkedin from "../../linkedin.app.mjs";
export default {
key: "linkedin-get-organization-access-control",
name: "Gets Organization Access Control",
description: "Gets an organization's access control information, given the organization urn. [See the docs here](https://docs.microsoft.com/en-us/linkedin/marketing/integrations/community-management/organizations/organization-access-control?context=linkedin/compliance/context#find-access-control-information)",
version: "0.1.6",
description: "Gets a selected organization's access control information. [See the documentation](https://learn.microsoft.com/en-us/linkedin/marketing/community-management/organizations/organization-access-control-by-role?view=li-lms-2025-01&tabs=http#find-organization-access-control)",
version: "0.2.0",
Comment on lines +6 to +7
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Verify the updated documentation URL is accessible.

The documentation URL has been updated to Microsoft's LinkedIn API documentation. Please ensure this URL is accessible and points to the correct documentation for the organization access control endpoint.


🌐 Web query:

Is the LinkedIn API documentation URL https://learn.microsoft.com/en-us/linkedin/marketing/community-management/organizations/organization-access-control-by-role?view=li-lms-2025-01&tabs=http#find-organization-access-control accessible and valid?

💡 Result:

The URL you provided for the LinkedIn API documentation:

https://learn.microsoft.com/en-us/linkedin/marketing/community-management/organizations/organization-access-control-by-role?view=li-lms-2025-01&tabs=http#find-organization-access-control

is not valid or accessible as a current, up-to-date documentation page.

  • The URL points to a specific version of the documentation (li-lms-2025-01), which appears to be outdated. According to LinkedIn's Microsoft Learn documentation, Marketing Version 202406 (June 2024) has been sunset, and developers are advised to migrate to the latest versioned APIs to avoid disruptions[3][6][7].

  • The current supported documentation for "Organization Access Control by Role" can be found under a newer version, such as li-lms-2025-06 (June 2025), for example:

    https://learn.microsoft.com/en-us/linkedin/marketing/community-management/organizations/organization-access-control-by-role?view=li-lms-2025-06
    

    This version contains the latest information, deprecation warnings, and migration recommendations[3].

  • If you visit the URL with view=li-lms-2025-01, it is likely to redirect, display a deprecation notice, or not show the most current API details[3][6][7]. Always use the documentation for the most recent supported version.

Recommendation:
Use the latest documentation version by replacing the version tag in the URL (e.g., ?view=li-lms-2025-06) to ensure you are seeing up-to-date and supported LinkedIn API information[3][6][7].

Citations:


Outdated LinkedIn API documentation version
The current link uses view=li-lms-2025-01, which is no longer up-to-date or accessible. Please update it to the latest supported version (li-lms-2025-06) to ensure developers see the correct endpoint details.

• File: components/linkedin/actions/get-organization-access-control/get-organization-access-control.mjs

 description: "Gets a selected organization's access control information. [See the documentation](https://learn.microsoft.com/en-us/linkedin/marketing/community-management/organizations/organization-access-control-by-role?view=li-lms-2025-01&tabs=http#find-organization-access-control)",
-version: "0.2.0",
+description: "Gets a selected organization's access control information. [See the documentation](https://learn.microsoft.com/en-us/linkedin/marketing/community-management/organizations/organization-access-control-by-role?view=li-lms-2025-06&tabs=http#find-organization-access-control)",
 version: "0.2.0",

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In
components/linkedin/actions/get-organization-access-control/get-organization-access-control.mjs
around lines 6 to 7, the LinkedIn API documentation URL uses an outdated version
parameter 'view=li-lms-2025-01'. Update this parameter to the latest supported
version 'li-lms-2025-06' in the description string to ensure the documentation
link points to the current API details.

type: "action",
props: {
linkedin,
organizationUrn: {
type: "string",
label: "Organization Urn",
description: "The organizational entity for which the access control information is being retrieved. Must be in URN format urn:li:organization:{id}.",
organizationId: {
propDefinition: [
linkedin,
"organizationId",
],
description: "The ID of the organization for which the access control information is being retrieved",
},
max: {
propDefinition: [
Expand All @@ -25,12 +27,14 @@ export default {
const count = 50;
const results = [];

const params = `q=organization&organization=${this.organizationUrn.replace(/:/g, "%3A")}&count=${count}`;
const organizationUrn = `urn:li:organization:${this.organizationId}`;

const params = `q=organization&organization=${organizationUrn.replace(/:/g, "%3A")}&count=${count}`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Replace manual URL encoding with proper encoding function.

The manual replacement of colons with %3A is not robust and could miss other characters that need encoding. Consider using JavaScript's built-in encodeURIComponent() function for proper URL encoding.

-    const params = `q=organization&organization=${organizationUrn.replace(/:/g, "%3A")}&count=${count}`;
+    const params = `q=organization&organization=${encodeURIComponent(organizationUrn)}&count=${count}`;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const params = `q=organization&organization=${organizationUrn.replace(/:/g, "%3A")}&count=${count}`;
const params = `q=organization&organization=${encodeURIComponent(organizationUrn)}&count=${count}`;
🤖 Prompt for AI Agents
In
components/linkedin/actions/get-organization-access-control/get-organization-access-control.mjs
at line 32, replace the manual colon replacement in the organizationUrn string
with a call to encodeURIComponent() to properly encode the entire parameter
value. This ensures all special characters are correctly encoded instead of only
colons.


let done = false;
do {
const { data: { elements } } = await this.linkedin.getAccessControl({
params: params + `&start=${start}`,
strParams: params + `&start=${start}`,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Verify parameter name consistency with LinkedIn app method.

The parameter name changed from params to strParams. Ensure this aligns with the updated method signature in the LinkedIn app and that all related actions use consistent parameter naming.


🏁 Script executed:

#!/bin/bash
# Description: Verify the getAccessControl method signature and parameter usage across LinkedIn actions

# Search for the getAccessControl method definition in the LinkedIn app
ast-grep --pattern 'getAccessControl($_, $_) {
  $$$
}'

# Search for all usages of getAccessControl to ensure consistent parameter naming
rg -A 3 'getAccessControl\('

Length of output: 1927


Ensure all getAccessControl calls use strParams
The app’s getAccessControl({ strParams, … }) signature requires a strParams key—only the member-organization action still passes params. Update this to prevent runtime errors.

• components/linkedin/actions/get-member-organization-access-control/get-member-organization-access-control.mjs

 await this.linkedin.getAccessControl({
     $,
-      params,
+      strParams: params,
 });

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In
components/linkedin/actions/get-organization-access-control/get-organization-access-control.mjs
at line 37, the call to getAccessControl incorrectly uses params instead of
strParams. Update the call to pass strParams with the correct string parameter
value to match the expected function signature and avoid runtime errors.

});

results.push(...elements);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,32 @@ import linkedin from "../../linkedin.app.mjs";
export default {
key: "linkedin-get-organization-administrators",
name: "Get Organization Administrators",
description: "Gets the administator members of an organization, given the organization urn. [See the docs here](https://docs.microsoft.com/en-us/linkedin/marketing/integrations/community-management/organizations/organization-access-control?context=linkedin/compliance/context#find-organization-administrators)",
version: "0.2.6",
description: "Gets the administrator members of a selected organization. [See the documentation](https://learn.microsoft.com/en-us/linkedin/marketing/community-management/organizations/organization-access-control-by-role?view=li-lms-2025-01&tabs=http#find-organization-administrators)",
version: "0.3.0",
type: "action",
props: {
linkedin,
organizationUrn: {
type: "string",
label: "Organization",
description: "The organizational entity for which administrators are being retrieved. Must be in URN format urn:li:organization:{id}.",
},
max: {
organizationId: {
propDefinition: [
linkedin,
"max",
"organizationId",
],
description: "The ID of the organization for which administrators are being retrieved",
},
},
async run({ $ }) {
let start = 0;
const count = 50;
const results = [];

const params = `q=organization&organization=${this.organizationUrn.replace(/:/g, "%3A")}&role=ADMINISTRATOR&state=APPROVED&count=${count}`;
const organizationUrn = `urn:li:organization:${this.organizationId}`;

const params = `q=organization&organization=${organizationUrn.replace(/:/g, "%3A")}&role=ADMINISTRATOR&state=APPROVED&count=${count}`;

let done = false;
do {
const { data: { elements } } = await this.linkedin.getAccessControl({
params: params + `&start=${start}`,
strParams: params + `&start=${start}`,
});

results.push(...elements);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import linkedin from "../../linkedin.app.mjs";
import constants from "../../common/constants.mjs";

export default {
key: "linkedin-get-profile-picture-fields",
name: "Get Profile Picture Fields",
description: "Gets the authenticated user's profile picture data including display image and metadata. [See the documentation](https://learn.microsoft.com/en-us/linkedin/shared/references/v2/profile/profile-picture)",
version: "0.0.1",
type: "action",
props: {
linkedin,
includeOriginalImage: {
type: "boolean",
label: "Include Original Image",
description: "Whether to include the original image data in the response (requires special permissions)",
optional: true,
default: false,
},
},
methods: {
getProfilePictureFields(args) {
return this.linkedin._makeRequest({
url: `${constants.BASE_URL}v2/me`,
...args,
});
},
},
async run({ $ }) {
let projection = "id,profilePicture(displayImage~digitalmediaAsset:playableStreams";

if (this.includeOriginalImage) {
projection += ",originalImage~digitalmediaAsset:playableStreams";
}

projection += ")";

const response = await this.getProfilePictureFields({
$,
params: {
projection: `(${projection})`,
},
});

if (response.profilePicture) {
$.export("$summary", "Successfully retrieved profile picture fields");
} else {
$.export("$summary", "Profile retrieved, but no profile picture found for this account");
}

return response;
},
};
9 changes: 7 additions & 2 deletions components/linkedin/linkedin.app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,14 @@ export default {
...args,
});
},
async getAccessControl({ params }) {
async getAccessControl({
strParams, ...args
}) {
return this._makeRequestAxios({
path: `/organizationAcls?${params}`,
path: `/organizationAcls${strParams
? `?${strParams}`
: ""}`,
...args,
});
},
async queryAnaltyics(query, args = {} ) {
Expand Down
2 changes: 1 addition & 1 deletion components/linkedin/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@pipedream/linkedin",
"version": "1.0.1",
"version": "1.1.0",
"description": "Pipedream Linkedin Components",
"main": "linkedin.app.mjs",
"keywords": [
Expand Down
5 changes: 3 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading