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

Content Server API

0
Posted May 05 by Abhishek Praharaj.

HI,

Do we have a small example to understand the working of the content server API in OTAG?

1 Answer

1
BEST ANSWER: As chosen by the author.

You can use any example you find in this forum or elsewhere. OTAG specifics lie in being a reverse proxy and supporting the SSO with the OTDS.

Using the reverse proxy means specifying the URL, which you configured on OTAG, instead of the actual CS CGI URL.

Taking advantage of the SSO is possible if you connect to the CS, which is bound to the same OTDS as your OTAG. You have already logged in to OTAG and thus have the OTDS ticket, which is accepted by the CS REST API too:

var otcsTicket;
$.ajax({
  type: "GET", url: "//hostname/cs/cs/api/v1/volumes/142",
  headers: otcsTicket ? { OTCSTicket: otcsTicket } : { OTDSTicket: window.otdsticket }
}).done(function (response, status, request) {
  otcsTicket = request.getResponseHeader("OTCSTicket");
  alert(response.data.name);
});

The way I read the OTDS ticket value in the code above is definitely wrong, but someone here will correct me. Thanks! :-) You should exchange the OTDS ticket for the OTCS ticket in your first HTTP request; the OTDS ticket can be single-time usable only and the OTCS ticket, which is native for the CS REST API, offers a better performance.

You can connect to any CS from OTAG. You'll have to provide some authentication which the CS REST API accepts. It means one of the HTTP headers OTCSTicket, OTDSTicket, MYSAPSSO2 or Authorization (for Basic Authentication).


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

Statistics

Related categories

Your answer

To leave an answer, please sign in.