# List Articles GET http://localhost:5000/myinstance1/articles Description:
The endpoint should return a list of articles in deterministic order.
We recommend a rate limit of 10 req/sec for this endpoint.

Usage:
Moveworks will call this endpoint to ingest articles every 4 hours.
Ask your CSE if you wish to increase or decrease the polling frequency. Reference: https://docs.moveworks.com/api-reference/legacy-gateways/knowledge-gateway/list-articles ## OpenAPI Specification ```yaml openapi: 3.1.1 info: title: List Articles version: endpoint_.listArticles paths: /articles: get: operationId: list-articles summary: List Articles description: >- Description:
The endpoint should return a list of articles in deterministic order.
We recommend a rate limit of 10 req/sec for this endpoint.

Usage:
Moveworks will call this endpoint to ingest articles every 4 hours.
Ask your CSE if you wish to increase or decrease the polling frequency. tags: - [] parameters: - name: pageToken in: query description: >- `pageToken` is used to paginate query results.
If `pageToken` is not used in a request, the response should default to the first page.

The response should always include a `next_page_token` field.
To obtain the next page of results, the client will use `next_page_token` as the value of `pageToken` in the next request. When combining the filter parameter with the `pageToken` parameter, servers must ensure that the client uses the appropriate `pageToken` value for the specified filter string. Failure to do so should result in the server throwing an "INPUT_VALIDATION_FAILED". required: false schema: type: string - name: pageSize in: query description: > `pageSize` defines the maximum number of articles to return in a single query.

Moveworks will take a max of 1000 articles in a single response. However, the server can return less than 1000 if desired. required: false schema: type: integer format: int64 - name: filter in: query description: > Defines a filter expression that narrows down the returned set of items. It allows you to specify criteria, such as numeric comparisons or string matching, to filter the items based on the values of their properties. The filter parameter must include at least one valid Boolean expression. Each expression should consist of an attribute name, followed by an attribute operator and a value. You have the flexibility to combine multiple expressions using logical operators, and you can also group expressions together using parentheses “()”. Here are the available attribute operators and their descriptions: - **`eq`** (equal): The attribute and operator values must be identical for a match. - **`ne`** (not equal): The attribute and operator values are not identical. - **`gt`** (greater than): If the attribute value is greater than the operator value, there is a match. The actual comparison depends on the attribute type. - **`lt`** (less than): If the attribute value is less than the operator value, there is a match. The actual comparison depends on the attribute type. The boolean operators available for combining expressions are: - **`and`** (Logical AND): The filter is considered a match only if both expressions evaluate to true. - **`or`** (Logical OR): The filter is considered a match if either of the expressions evaluates to true. Parentheses **`()`** can be used to group boolean expressions and alter the standard order of operations. By grouping expressions with parentheses, you can control how the logical OR operation is evaluated and prioritize certain conditions over others. This allows for more flexibility and precision in constructing complex boolean expressions. Attribute names and attribute operators used in filters are case insensitive. For example, the following two expressions will evaluate to the same logical value: filter=article.state Eq "ACTIVE" filter=article.State eq "ACTIVE" The evaluation of filters follows a standard order of operations. Attribute operators take precedence over other operators, followed by the grouping operator (parentheses), then the logical AND operator, and finally the logical OR operator. If the requested filter operation is not recognised, providers must refuse to filter the results and return an HTTP 400 error with an appropriate human readable response. **Here are some examples of filter expressions:** In the provided examples, we have utilised the suggested response structure as defined in the response section. However, it's important to note that these expressions may differ if you opt for an alternative response format or structure. - filter=last_modified_at gt "2011-05-13T04:42:34Z" - filter=article.state ne “INACTIVE” and last_modified_at gt "2011-05-13T04:42:34Z" required: false schema: type: string - name: Authorization in: header description: >- Bearer authentication of the form `Bearer `, where token is your auth token. required: true schema: type: string responses: '200': description: | List of articles content: application/json: schema: $ref: '#/components/schemas/listArticles_Response_200' components: schemas: Article: type: object properties: id: type: string description: >- The id field is a unique identifier for each API response. It helps users to distinguish between different articles or entities in the system. This ID can be used for referencing, updating, or deleting specific articles. However Moveworks only fetches the articles without modifying them title: type: string description: >- The title field represents the title or headline of the article. It shoutld be a concise and descriptive string that gives users an idea of what the article is about. body: type: string description: >- The body field contains the main content of the article. It includes the detailed information, text, or HTML markup that constitutes the actual content of the article. link: type: string description: >- The link field typically provides a URL that users can follow to access the full article on a web page. Moveworks gets the snippets from the articles and serves as an answer to the end users for full view users can use this link to access the full article. created_at: type: string format: timestamp description: >- The created at field denotes the date and time when the article was originally created or published. It provides valuable information about the article's age and can be useful for sorting and filtering articles based on their creation date. It needs to be in ISO 8601 UTC. updated_at: type: string format: timestamp description: >- The Updated at field denotes the date and time when the article was updated. It provides valuable information about the article's age and can be useful for sorting and filtering articles based on their updation date. If updated at is not present delta ingestion support will not be possible in future for knowledge ingestion. It needs to be in ISO 8601 UTC created_by: type: string description: >- The Created by field captures the email address of the user who has created this article. updated_by: type: string description: >- The Updated by field captures the email address of the last user who has updated this article required: - id - title - body - link listArticles_Response_200: type: object properties: results: type: array items: $ref: '#/components/schemas/Article' next_page_token: type: string description: >- The value provided serves as the starting point for fetching the next page of records. In the next call, use this value as the pageToken parameter. required: - results ``` ## SDK Code Examples ```python import requests url = "http://localhost:5000/myinstance1/articles" querystring = {"filter":"article.state eq \"ACTIVE\"\n"} headers = {"Authorization": "Bearer "} response = requests.get(url, headers=headers, params=querystring) print(response.json()) ``` ```javascript const url = 'http://localhost:5000/myinstance1/articles?filter=article.state+eq+%22ACTIVE%22%0A'; const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go package main import ( "fmt" "net/http" "io" ) func main() { url := "http://localhost:5000/myinstance1/articles?filter=article.state+eq+%22ACTIVE%22%0A" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby require 'uri' require 'net/http' url = URI("http://localhost:5000/myinstance1/articles?filter=article.state+eq+%22ACTIVE%22%0A") http = Net::HTTP.new(url.host, url.port) request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` ```java import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("http://localhost:5000/myinstance1/articles?filter=article.state+eq+%22ACTIVE%22%0A") .header("Authorization", "Bearer ") .asString(); ``` ```php request('GET', 'http://localhost:5000/myinstance1/articles?filter=article.state+eq+%22ACTIVE%22%0A', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` ```csharp using RestSharp; var client = new RestClient("http://localhost:5000/myinstance1/articles?filter=article.state+eq+%22ACTIVE%22%0A"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` ```swift import Foundation let headers = ["Authorization": "Bearer "] let request = NSMutableURLRequest(url: NSURL(string: "http://localhost:5000/myinstance1/articles?filter=article.state+eq+%22ACTIVE%22%0A")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```