- Portal Manager
- V4
- Get Article by ID
The Get Article by ID API allows a user or client application to retrieve an Article using its ID.
- It requires a Portal ID, which a user or client application can retrieve through the Administrative Console or by calling Get All Portals API.
- Additional Article attributes and contextual views can be specified in the query parameters.
This API returns structured authoring attributes of Issue, Environment, Cause and Confidence Level when the following conditions are met:
- The "Allow Structured Authoring" setting is enabled at the partition/department level through the Administrative Console.
- The "Use Structured Authoring" flag is set on the article type.
- Agents without a user profile and customers in a portal without a default user profile only have access to articles that:
- Do not contain any access tags.
- Do not contain any publish views.
- Contain publish views without any associated tags.
- Agents with a user profile and customers in a portal with a default user profile have access to articles that:
- Do not contain any access tags.
- Do not contain any publish views.
- Contain publish views without any associated tags.
- Contain access tags that are also in the assigned user profiles.
- Contain publish views with associated tags that are also in the assigned user profiles.
- Agents with the following assigned actions can view updates to articles currently being processed in workflows:
- View Author Portal – Allows agents to view updates to articles at any stage in a workflow.
- View Staging Portal – Allows agents to view updates to articles in the Staging stage or a subsequent stage in a workflow.
The attributes of an Article to be returned in addition to the default list of attributes, listed below. Multiple additional attributes can be specified using a comma-separated list. Passing 'all' will return all attributes.
These Article attributes are always returned:
| Name | Description |
|---|---|
| id | The ID of the Article. |
| name | The name of the Article. |
| additionalInfo | Additional information provided as Article metadata. |
| articleType | The Article type and its attributes. |
| articleKeywords | A comma-separated list of keywords associated with this Article. |
| articleState | The current state of the Article. States include A (Authoring), S (Staging), and P (Published). |
| articleSummary | A brief summary of the Article, provided as metadata. |
| createdBy | The ID, first name, middle name and last name of the user that created the Article. |
| createdDate | The date that the Article was created. |
| departmentId | ID of the department for which this Article belongs to. |
| description | The Article's description. |
| expirationDate | The date that the Article is set to expire. |
| attachments | The Article's attachments |
| imageURL | The URL of the image that is present in the Article version. It is used as the thumbnail image for the Article. |
| includeInGenAI | Indicates whether this Article is used for eGain's generative AI features. |
| isSubscribed | Indicates whether the Article is subscribed for notifications. |
| languageCode | The language code of the Article language. |
| link | The link object, used to retrieve the details of the Article. |
| modifiedBy | The ID, first name, middle name and last name of the user that last modified the Article. |
| modifiedDate | The date that the Article was last modified on. |
| topicBreadcrumb | Contains a list of topics from the top-level topic to this Article. There may be multiple paths. |
| versionId | The ID of the Article version that is returned. |
One or more comma-separated names for custom attributes defined by the user to be returned.
Provides information about the method in which the Article is accessed and is used for self-service analytics. Refer to the eGain User Guide regarding "Article View Contexts".
| Name | Description |
|---|---|
| article_view | View an Article directly using its ID. |
| article_view_more_related_Article | View related articles of an Article using its ID. |
| article_view_basic_search | View an Article via a basic search. |
| article_view_adv_search | View an Article via an advanced search. |
| article_view_guided_help | View an Article via a Guided Help solution. |
| article_view_browse_topic | View an Article via browsing a topic. |
| article_view_browse_tree | View an Article via browsing a topic tree. |
| article_view_popular_articles | View an Article using the Popular Items list in the Self-Service portal. |
| article_view_useful_items | View Article using the Useful Items list in the Self-Service portal. |
| article_view_widget | View an Article via a widget. |
| article_view_announcement | View an Article from the announcement section in the Self-Service portal. |
| article_view_bookmarked | View a bookmarked Article. |
| article_view_subscription_notification | View an Article from a subscription notification. |
| article_view_guided_help_additional_info | View an Article via additional information from a Guided Help search. |
| view_articles_pending_compliance | View an Article via Read & Sign in the Self-Service portal. |
| type_ahead_Suggestion | View an Article from a type-ahead Suggestion in the Self-Service portal. |
| semantic_Suggestion | View an Article from a semantic Suggestion in the Self-Service portal. |
| instant_answer | View an Article via an Instant Answers solution. |
| instant_answer_reference | View an Article that is used as a reference for an Instant Answers solution. |
The ID of a publish view for an Article. A publish view is a set of tags used to generate multiple editions of the same Article for display on the self-service portal. Publish views are used in conjunction with single sourcing to tailor the content of an Article to a specific audience by granting access to an Article's version to users that possess the same tags.
A publish view ID is composed of a 4-letter prefix, followed by a dash and 4-15 digits.
For agents with the View Author Portal or View Staging Portal actions, this determines which version of the Article is returned.
The unique numeric identifier for a tenant, used in self-service functionality as well as third-party integrations.
Note: The x-ext-integration-id and x-ext-interaction-id headers must always be provided together and cannot be supplied independently.
The x-egain-activity-id may be provided on its own, or it may be provided along with both x-ext-integration-id and x-ext-interaction-id.
A unique interaction identifier from other CRM applications.
Note: The x-ext-integration-id and x-ext-interaction-id headers must always be provided together and cannot be supplied independently.
The x-egain-activity-id may be provided on its own, or it may be provided along with both x-ext-integration-id and x-ext-interaction-id.
- oAuthUser
- oAuthCustomer
- oAuthOnBehalfOfUser
- oAuthOnBehalfOfCustomer
- oAuthAnonymousCustomer
curl -i -X GET \
'https://api.egain.cloud/knowledge/portalmgr/v4/portals/PROD-1000/articles/PROD-2996?%24lang=en-US&articleAdditionalAttributes=averageRating&%24customAdditionalAttributes=country_name&accessSource=article_view&publishViewId=PROD-3203&workflowMilestone=publish' \
-H 'Accept-Language: en-US' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'x-egain-activity-id: 59237' \
-H 'x-ext-integration-id: 3155180e-0c13-43e9-9c38-e9045bcbf176' \
-H 'x-ext-interaction-id: 3155180e-0c13-43e9-9c38-e9045bcbf176'Success
The ID of the Article.
An Article ID is composed of a 2-4 letter prefix, followed by a dash and 4-15 digits.
Additional information about the Article. Max 1 KB.
The name of the macro associated with this Article.
A comma-separated list of keywords associated with this Article. 1 KB max size limit.
A brief summary of the Article, provided as metadata. 1 KB max size limit.
The date on which the Article version is available.
The editions of this Article that are available to the user.
The Article content. The maximum allowed Article content size is 2 MB.
The plaintext version of the Article content, which does not have the HTML tags and rich formatting present in content. The maximum allowed Article content size is 2 MB.
A description of the Article. The maximum allowed Article description size is 1 KB.
Date of Article expiration if Article expires otherwise empty.
The URL of an image to be associated with the Article.
The date on which the Article was last modified.
Language code of the resource's language.
The ID of this version of the Article.
Personalization allows the filtering of search results and controls the access to articles and article editions.
- Summary Attributes
- Summary Attributes with Structured Authoring enabled
- All Attributes
{ "id": "PROD-2996", "name": "Fair Lending FAQs", "additionalInfo": "Can be shared to public.", "articleType": { "articleCategoryId": 0, "typeName": "General", "useStructuredAuthoring": false, "articleTypeId": "999900000002020" }, "articleKeywords": "Fair lending, Fair Housing Act, Discrimination protection, Residential mortgage loans, Equal opportunity housing", "articleState": "P", "articleSummary": "Fair lending ensures that lenders do not discriminate based on race, color,national origin, religion, sex, familial status, or disability when applying forresidential mortgage loans. The federal Fair Housing Act protects individuals'fair lending rights, enforced by the Office of Fair Housing and Equal Opportunity,along with state and local agencies. This law applies to U.S. citizens, greencard holders, and undocumented residents, ensuring equal opportunities in homesales, rentals, and financing.", "attachments": [ { … } ], "createdBy": { "id": "1013", "firstName": "John", "middleName": "", "lastName": "Doe" }, "createdDate": "2022-06-30T14:54:55Z", "departmentID": "1001", "description": "Common questions and answers regarding Fair Lending.", "expirationDate": "2031-01-02T10:56:00Z", "imageURL": "https://hd.egain.com/images/km-for-dummies-24.jpg", "includeInGenAI": true, "isSubscribed": true, "languageCode": "en-US", "modifiedBy": { "id": "1013", "firstName": "John", "middleName": "", "lastName": "Doe" }, "modifiedDate": "2025-01-28T19:53:58Z", "link": { "rel": "self", "href": "/knowledge/portalmgr/v4/portals/PROD-1000/articles/PROD-2996?%&workflowMilestone=publish&accessSource=article_view&publishViewId=PROD-3203&%24lang=en-US" }, "topicBreadcrumb": [ { … } ], "versionId": "PROD-2884" }