OpenText API authentication failed.
Answers
-
Ok, let's check everything. First, the authentication URL:
In the example above, the variables for you should look like this:
apigee_host = https://us.api.opentext.com
tenant_id = the tenant id that is subscribed to the application
Body → raw → JSON
If that is still not working, from the body, remove the username and password keys and values and change the grant_type to client_credentials, like below:
0 -
Hi LazarescuA
Now it returned the token and other details.
Problem was type "text" instead of "json"
Thanks..
0 -
Hi LazarescuA
I'm trying to upload the first file.
I got the response from the api call as below.
========
StatusCode = "NotFound"
========
These are my url, header parameters and the body as the file byte array.
RestClient restClient = new RestClient("https://us.api.opentext.com");
restRequest = new RestRequest("/cp-rest/v2/session/files", Method.Post)
restRequest.AddHeader("Authorization", "Bearer " + tokenResponseData.access_token)
restRequest.AddHeader("Accept", "application/hal+json")
restRequest.AddHeader("Accept-Language", "en-US")
restRequest.AddHeader("Content-Type", "image/jpg")
restRequest.AddHeader("Content-Length", fileBytes.Length)
restRequest.AddBody(fileBytes)
Any mistake in the base-url of the restclient, api url in the restrequest or header parameters or body byte array?
Please let me know any more things to adjust in the account or my coding.
Thanks..
0 -
Hi LazarescuA
Sorry for the misatke..
These are the points I have mistaken.
- I have used the url "/cp-rest/v2/session/files" instead of "/capture/cp-rest/v2/session/files. That raised the error "Not Found".
- Then again it raised the "MediaType Error". I have used a JPG file. Then when I used a TIFF file it uploaded the file without error.
With that, I have a new question to ask.
Can't we upload files as JPG, JPEG, PNG etc?
0 -
Hi LazarescuA
Now I could work with png, jpg, jpeg as well same as tiff.
Problem was in jpg, I have set the type as "image/jpg" instead of "image/jpeg"
Thanks..
0
Categories
- All Categories
- 123 Developer Announcements
- 54 Articles
- 156 General Questions
- 150 Thrust Services
- 57 Developer Hackathon
- 38 Thrust Studio
- 20.6K Analytics
- 4.2K AppWorks
- 9K Extended ECM
- 918 Core Messaging
- 84 Digital Asset Management
- 9.4K Documentum
- 33 eDOCS
- 191 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 10 XM Fax
- Follow Categories