Exstream API and OTDS Token
Hi,
Using OTDS how to get Bearer Token for API Authentication. And, what is expiry time limit for token.
Comments
-
Hi, hope this can give you a hint... :-)
<?php
/*
Proof of concept script
Do not use on production
*/
// HTTPFUL Library
error_reporting(-1);
ini_set('display_errors', 'On');
include('httpful.phar');
// Initial header
$header = array(
'Content-Type' => 'application/json',
);
// OAuth and Extream paths
$oauth_path = 'https://.../otdsws/v1/authentication/credentials';
$document_path = 'https://.../v1/documents/';
// Get Token/OTDSTicket
$auth = \Httpful\Request::post($oauth_path)
->addHeaders($header)
->body(json_encode(array(
'user_name' => '',
'password' => '',
)))
->send();
// Update header with authentication ticket
$header['OTDSTicket'] = $auth->body->ticket;
// Search for a document
$document = \Httpful\Request::get($document_path.
'?where_typeid=archiveobject'.
'&where_filter=["EQ","**Field GUID**","**Field value**"]'.
'&guid_format=false')
->addHeaders($header)
->send();
// Get the first document we find in the search
$firstDocument = $document->body->data[0];
// Get the related file
$documentData = \Httpful\Request::get($document_path . $firstDocument->id . '/content')
->addHeaders($header)
->send();
// Dump the test file
file_put_contents('test_file.pdf', $documentData);
?>
2 -
Really helpful, you are my hero!!
0
Categories
- All Categories
- 122 Developer Announcements
- 53 Articles
- 149 General Questions
- 148 Thrust Services
- 56 OpenText Hackathon
- 35 Developer Tools
- 20.6K Analytics
- 4.2K AppWorks
- 9K Extended ECM
- 917 Cloud Fax and Notifications
- 84 Digital Asset Management
- 9.4K Documentum
- 31 eDOCS
- 181 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 8 XM Fax
- Follow Categories