Service | Introducing Oracle Service Cloud Knowledge Advanced REST API

[music] Hello, my name is Gowri. In this tutorial, I’ll give you an overview of the Oracle Service Cloud Knowledge Advanced REST API. You can use the Service Cloud Knowledge Advanced REST APIs to create, manage, and search knowledge articles; build integrations with other application suites, and view user information from external applications. To make REST API calls, I’m using a GitBash command line to run cURL commands. Before I make any REST call to the Knowledge
Advanced REST server, I need proper authentication and authorization. To authenticate myself, I will run this cURL command. I must use the POST method with a URL in the specified format. The URL has four parts. The first part describes the site name and the second part describes the API category. Here, you can choose to specify either ‘km’ for Content IM that is Information Manager, as shown or ‘srt’ for Search. Third part describes the API version. Here, I use the word ‘’latest” to get the most recent version. You can also choose to specify the exact version of the api, for example “v1” or “v2.1”. The last part as shown here, from auth to authorize, must be used as it is while sending an authentication request. For authentication, I must also specify a custom token called kmauthtoken. The token value contains the site name in JSON format as shown here. I’ve provided my authentication credentials in a JSON file and I’m referencing the file in the cURL command. The credentials must be specified in the JSON format as shown. Here, login describes user name, password describes password, and site Name describes name of the site. After the authentication is successful, an authentication token is returned. I copy the token value and use it in my subsequent authorization request. For authorization, I must use a POST request with a URL in the specified format. The URL must end with ‘auth/authorize’ after the api version. I specify ‘kmauthtoken’ in this command as I did earlier for authentication. In addition, I also have to specify the authentication token value that I received from the previous request and mention it as ‘integrationUserToken’. I’ve provided my authorization credentials in a text file. Then, I’m referencing the file in the cURL command. As shown, the authorization credentials must contain user name, password, site name, and user type as ampersand separated values. After the authorization is successful, a response is returned. The response contains an authentication token, user information such as, user name, last name, record ID and so on. The authentication token in turn contains an integration user token and a user token. As the authorization is successful, I can now make a sample REST API call. I’ll send a GET request to retrieve all the content articles from the knowledge base. In this REST call, I must specify the kmauthtoken with siteName and integrationUserToken values in it. I must also specify my authorization credentials. The response returned contains all the content articles stored in the knowledge base. Thank you. [music]

Leave a Reply