You can fetch a list of all news items
Security
bearerAuth
Intercom-Versionstring(intercom_version)
Intercom API version.
By default, it's equal to the version set in the app package.
Default:"Preview"
Enum:"1.0""1.1""1.2""1.3""1.4""2.0""2.1""2.2""2.3""2.4"
Example:Preview
- The production API serverhttps://api.intercom.io/news/news_items
- The european API serverhttps://api.eu.intercom.io/news/news_items
- The australian API serverhttps://api.au.intercom.io/news/news_items
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
reqUrl := "https://api.intercom.io/news/news_items"
req, err := http.NewRequest("GET", reqUrl, nil)
if err != nil {
panic(err)
}
req.Header.Add("Intercom-Version", "Preview")
req.Header.Add("Authorization", "Bearer <YOUR_TOKEN_HERE>")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(res)
fmt.Println(string(body))
}successful
pagesobject or null(Cursor based pages)
Cursor-based pagination is a technique used in the Intercom API to navigate through large amounts of data. A "cursor" or pointer is used to keep track of the current position in the result set, allowing the API to return the data in small chunks or "pages" as needed.
Response
- News Item
- Newsfeed
{ "type": "list", "pages": { "page": 1, "per_page": 10, "total_pages": 1, "type": "pages" }, "data": [ { … }, { … } ], "total_count": 2 }