Content Services GraphQL API
Use the API to create, retrieve, update, or delete resources. The API is ideal for web and mobile application development because it supports retrieving exactly the data you need with a single call. By default, this API is provisioned on your subscription.
Overview
The Content Services GraphQL API provides a schema and an easy-to-understand query language system that simplifies application development for your Content Platform Engine. The API schema definition of types and fields matches Content Engine Java API object model closely, with necessary and desirable extensions for natural GraphQL developer consumption.
- Metadata discovery
- Document and Folder operations
- Search operations
- Browse operations
-
https://hostname.automationcloud.ibm.com.com/dba/environment/content-services-graphql/graphql
-
https://fncm-environment-hostname.automationcloud.ibm.com/content-services-graphql/graphql
dev
for the development
environment, test
for the test environment, or run
for the
production environment. -
https://hostname.automationcloud.ibm.com/dba/environment/content-services-graphql/
-
https://fncm-environment-hostname.automationcloud.ibm.com/content-services-graphql/
All applications that use the GraphQL API must pass a ECM-CS-XSRF-Token token in the header and the cookie. It is recommended that the GraphQL client generates the token, sets it as a cookie on the client browser, and saves the same value in the user session. When a client request comes, the GraphQL client validates the ECM-CS-XSRF-Token cookie against the saved value. When the request is passed to Content Services GraphQL, these values are in the header ECM-CS-XSRF-Token and cookie EM-CS-XSRF-Token.
Testing connection to the API
After you access the GraphQL instance for the API, you can test the connection to the Content Platform Engine as shown in the following example.{
_apiInfo(repositoryIdentifier: "OS1") {
buildDate
buildNumber
implementationVersion
implementationTitle
productVersion
cpeInfo {
cpeURL
cpeUser
repositoryName
}
}
}
The value for the repositoryIdentifier
is the Content Platform Engine object store name
(symbolic name) or ID (GUID).{
"data": {
"_apiInfo": {
"buildDate": "February 28, 2020 at 09:20",
"buildNumber": "29",
"implementationVersion": "20200228-0920-29-pwtest330",
"implementationTitle": "IBM FileNet Content Services GraphQL API - content-graphql-api",
"productVersion": "5.5.4",
"cpeInfo": {
"cpeURL": "http://cpe_host:port/wsi/FNCEWS40MTOM/",
"cpeUser": "uid=admin@ibm.com,cn=users,O=IBM,C=US",
"repositoryName": "OS1"
}
}
}
}
A developer guide is available for the API. For more information, see Content Services GraphQL API Developer Guide in the IBM® FileNet® P8 Platform documentation.
Using webhooks
The Content Services GraphQL API supports webhooks. Webhooks are user-defined HTTP callbacks made with HTTP POST requests. They provide a way for the Content Platform Engine to provide near real-time information to other interested applications or services.
The callbacks can be triggered by events in the Content Platform Engine, such as checking in a document to a repository or updating a property on a Content Platform Engine object. The Content Engine then makes an HTTP POST request to the URL that is configured for the webhook.
For more information about event webhooks, see Content Platform Engine event webhooks and Content event webhook examples.