|
6 | 6 | CheckConnectionStatus, |
7 | 7 | CommentOnPost, |
8 | 8 | CreatePost, |
| 9 | + CreateRepost, |
9 | 10 | CustomWorkflow, |
10 | 11 | FetchCompany, |
11 | 12 | FetchJob, |
@@ -135,6 +136,7 @@ class LinkedApi { |
135 | 136 | this.reactToComment = new ReactToComment(this.httpClient); |
136 | 137 | this.replyToComment = new ReplyToComment(this.httpClient); |
137 | 138 | this.createPost = new CreatePost(this.httpClient); |
| 139 | + this.createRepost = new CreateRepost(this.httpClient); |
138 | 140 | this.retrieveFeed = new RetrieveFeed(this.httpClient); |
139 | 141 | this.retrieveSSI = new RetrieveSSI(this.httpClient); |
140 | 142 | this.retrievePerformance = new RetrievePerformance(this.httpClient); |
@@ -177,6 +179,7 @@ class LinkedApi { |
177 | 179 | this.reactToComment, |
178 | 180 | this.replyToComment, |
179 | 181 | this.createPost, |
| 182 | + this.createRepost, |
180 | 183 | this.retrieveFeed, |
181 | 184 | this.retrieveSSI, |
182 | 185 | this.retrievePerformance, |
@@ -1465,12 +1468,16 @@ class LinkedApi { |
1465 | 1468 | /** |
1466 | 1469 | * Create a LinkedIn post on your personal profile or a company page. |
1467 | 1470 | * |
1468 | | - * This method creates a new post on LinkedIn. Posts can include text (up to 3,000 characters) |
1469 | | - * and optional media attachments (images, videos, or documents). For company posts, you must |
1470 | | - * have admin access to the company page. |
| 1471 | + * This method creates a new post on LinkedIn. Posts can include text (up to 3,000 characters), |
| 1472 | + * mentions of people and companies, and optional media attachments (images, videos, or |
| 1473 | + * documents). For company posts, you must have admin access to the company page. |
1471 | 1474 | * |
1472 | | - * @param params - Parameters including post text, optional attachments, and optional company URL |
1473 | | - * @returns Promise resolving to an object containing the created post URL |
| 1475 | + * Each mention binds a `@[key]` placeholder in the text to one entity. `name` is required even |
| 1476 | + * when an identifier is given, because LinkedIn resolves a mention through its own name |
| 1477 | + * suggestions; the identifier only decides which of the offered namesakes is taken. |
| 1478 | + * |
| 1479 | + * @param params - Parameters including post text, optional mentions, attachments, and company URL |
| 1480 | + * @returns Promise resolving to the created post's URL and URN |
1474 | 1481 | * |
1475 | 1482 | * @see {@link https://linkedapi.io/docs/action-st-create-post/ st.createPost Action Documentation} |
1476 | 1483 | * |
@@ -1519,6 +1526,50 @@ class LinkedApi { |
1519 | 1526 | */ |
1520 | 1527 | public createPost: CreatePost; |
1521 | 1528 |
|
| 1529 | + /** |
| 1530 | + * Repost a LinkedIn post, either as is or with your own commentary. |
| 1531 | + * |
| 1532 | + * Without `text` the post is reposted as is. With `text` your commentary (up to 3,000 characters, |
| 1533 | + * with optional mentions) is published above it. The post is addressed by `postUrl` or `postUrn`; |
| 1534 | + * provide one of the two. |
| 1535 | + * |
| 1536 | + * The returned identifiers belong to the repost itself, which is a post of your own account, not |
| 1537 | + * to the post that was reshared. Reposting the same post twice from the same account fails with |
| 1538 | + * `alreadyReposted`. |
| 1539 | + * |
| 1540 | + * @param params - Parameters including the post target and optional commentary with mentions |
| 1541 | + * @returns Promise resolving to the repost's own URL and URN |
| 1542 | + * |
| 1543 | + * @see {@link https://linkedapi.io/docs/action-st-create-repost/ st.createRepost Action Documentation} |
| 1544 | + * |
| 1545 | + * @example |
| 1546 | + * ```typescript |
| 1547 | + * // Repost as is |
| 1548 | + * const workflow = await linkedapi.createRepost.execute({ |
| 1549 | + * postUrl: "https://www.linkedin.com/posts/username_activity-id" |
| 1550 | + * }); |
| 1551 | + * |
| 1552 | + * const result = await linkedapi.createRepost.result(workflow.workflowId); |
| 1553 | + * console.log("Repost created:", result.data?.postUrl); |
| 1554 | + * ``` |
| 1555 | + * |
| 1556 | + * @example |
| 1557 | + * ```typescript |
| 1558 | + * // Repost with commentary, addressing the post by URN |
| 1559 | + * const workflow = await linkedapi.createRepost.execute({ |
| 1560 | + * postUrn: "urn:li:activity:1234567890123456789", |
| 1561 | + * text: "Worth reading, especially the part on onboarding by @[author]!", |
| 1562 | + * mentions: [ |
| 1563 | + * { key: "author", name: "Example Person", urn: "urn:li:member:123456789" } |
| 1564 | + * ] |
| 1565 | + * }); |
| 1566 | + * |
| 1567 | + * const result = await linkedapi.createRepost.result(workflow.workflowId); |
| 1568 | + * console.log("Repost created:", result.data?.postUrn); |
| 1569 | + * ``` |
| 1570 | + */ |
| 1571 | + public createRepost: CreateRepost; |
| 1572 | + |
1522 | 1573 | /** |
1523 | 1574 | * Retrieve your LinkedIn Social Selling Index (SSI) score. |
1524 | 1575 | * |
|
0 commit comments