Status: Open
Status: Answered
Status: Closed
Status: Duplicate

Content Server 10.5 REST API

0
Posted Feb 28 by Brian MacMillan.

I am working with a client on an upgrade project. This is on a Windows 2008 R2 Platform using SQL Server 2012 SP1 with Content Server 10.5.

We ran a minor test of the API and get a 500 error from the web server. The url was: http://server_name/OTCS5/cs.exe/api/v1 , where the server_name is the load balancer url. We tried with the server url and get the same issue. The similar url to CS 10 does connect to CS…

This is not a major issue at this time, however, it looks like the we must have something mis-configured. I assume that the REST API gets installed with CS 10.5, right? I believe CS10 required the REST API module or package to be installed separately (we have CS 10 Update 12 installed also).

9 Answers

1
BEST ANSWER: As chosen by the author.

Did you use exactly http://server_name/OTCS5/cs.exe/api/v1 as the URL? It doesn't point to a valid resource; it's just the REST API URL base. Try the Enterprise Workspace, for example: http://server_name/OTCS5/cs.exe/api/v1/volumes/141. See the API documentation too.

Yes, the REST API gets installed with the CS 10.5 automatically. The CS 10 needs the Update 13, which deploys the module to the staging directory for you, and you can finish the installation in the modules administration.


0
BEST ANSWER: As chosen by the author.

I'm also seeing the same error on a 10.5 test instance. Any other ideas? The /auth resource is the only one that returns a 500 error. Other resources return 401 unauthorized.


0
BEST ANSWER: As chosen by the author.

Same result when I make a GET request to e.g. /api/v1/volumes/141 with the Authorization header set.

I'm setting the Authorization header in the form: "Authorization: Basic [base64 encoded string of admin:password]". E.g.:

GET /OTCS/cs.exe/api/v1/volumes/141 HTTP/1.1
Host: 10.11.12.1
Content-Type: application/x-www-form-urlencoded
Authorization: Basic QWRtaW46cGFzc3dvcmQ=
Cache-Control: no-cache

Some sort of authentication does seem to work? As when I use base64 encoded string with the wrong password (deliberately) I get a 401, but with the correct password, a 500.

EDIT: Is now working. I didn't change anything except I logged in with the web interface, and the REST API started working after that.


0
BEST ANSWER: As chosen by the author.

The following urls from the server did yield an appropriate response (but not http):

http://server_name/OTCS5/cs.exe/api/v4/auth?username=Admin&password=Livelink

http://server_name/OTCS5/cs.exe/api/v4/nodes/59191?cstoken=JkizehiodYfr9%252FauUpcBJj%252BmhHUWFfz0R0CNCZ4433grf

So, my version was not correct for 10.5… it prompts for an open or save from the server.


0
BEST ANSWER: As chosen by the author.

Aidan,

Are you setting the otcsticket?


0
BEST ANSWER: As chosen by the author.

Brian,

You should use a REST API tool. Something like fiddler, or grabbing a REST client from the Chrome web store. Because you should be using a POST method to get the OTCS ticket, and then passing that info along in a get request, to pull data on that node.


0
BEST ANSWER: As chosen by the author.

Just to let you I have written an example when working with CS REST API using Postman Chrome Extension. It might be a help for anyone to get started.

Content Server REST API with Postman


0
BEST ANSWER: As chosen by the author.

The 401 for a wrong password is correct, but the 500 for the correct one from the /auth is an unexpected error. It should be inspected in logs or in the Builder/Oclipse.

How could it work after logging in to the classic CS web interface, I have no idea. It's a wonder :-)

The REST API removes any cookies sent by the browser before processing the request to resist CSRF attacks, which includes the (authentication) LLCookie. That's why you always have to send an authentication header, which must be recognized by an OScript login callback on the server. The 500 error could mean some problem with those.


0
BEST ANSWER: As chosen by the author.

Try a different user than Admin. The code 500 doesn't explain anything, but unless you investigate more in server logs, you can try different users. One of my colleagues experienced a similar issue and he said that the Admin account was not valid on the server he was connecting to.


 You have subscribed and will receive email notifications of updates to this topic. To unsubscribe, uncheck the checkbox.

Statistics

Related categories

Related tags

Your answer

To leave an answer, please sign in.