Documentum REST API issue - rest

I have successfully installed Documentum REST API in my environment. When I go to http://localhost:8080/dctm-rest/repositories I am able to see the repositories successfully. But when I when I try to open any cabinet URL there, it prompts for username password.
I put a password there and it works fine.
But when I send the request using Postman it shows this error
"status": 401,
"code": "E_GENERAL_AUTHENTICATION_ERROR",
"message": "Authentication failed.",
"details": "Full authentication is required to access this resource"
and when sending with Authorization in the format
Authorization : Basic (base64 value of "username:password")
it shows
"status": 400,
"code": "E_INPUT_ILLEGAL_ARGUMENTS_PARAM",
"message": "Illegal argument {0} provided with value {1}.",
"details": "Parameter conditions \"dql\" not met for actual request
parameters: "

You Have to turn on the Interceptor to make proxy-authenticated request so that it has the same request context as of browser.

I tried few links and used Basic Auth, which worked!

Related

how to specify a key file (key.json) in the url of creating a googlesheet

i have created a google service account, created a keyfile (key.json) and now I want to create a googlesheet using postman
https://sheets.googleapis.com/v4/spreadsheets?scope=https://www.googleapis.com/auth/spreadsheets&private-key-file=c:\temp\key.json
But I keep getting a 401 error - missing required credential
{
"error": {
"code": 401,
"message": "Request is missing required authentication credential. Expected OAuth 2 access token, login cookie or other valid
authentication credential. See
https://developers.google.com/identity/sign-in/web/devconsole-project.",
"status": "UNAUTHENTICATED"
}
}
what's the syntax to pass the key file in the url/header or body ?
thanks !
just goto authorization header and add the key and value as api key and select add in as "query parameter"
You can also manually add key and value as query parameter
Both does the exact same thing

Upload a image to Google Cloud Storage using Rest end point via API-KEY

I am new to Google Cloud. I want to upload an image to my Bucket.
I did it successfully from the GCP Console and GCP Shell. However, I am unable to do it using REST Endpoint using API-KEY.
Here is my URL.
https://www.googleapis.com/upload/storage/v1/b/[MY_BUCKET]/o?uploadType=media&name=myhero&key=[MY_API-KEY]
I am getting the following message
{
"error": {
"errors": [
{
"domain": "global",
"reason": "required",
"message": "Anonymous caller does not have storage.objects.create access to [MY_BUCKET]/myhero.",
"locationType": "header",
"location": "Authorization"
}
],
"code": 401,
"message": "Anonymous caller does not have storage.objects.create access to [MY_BUCKET]/myhero."
}
}
This is because the bucket currently does not allow any way to allow users with the API-KEY even though the API-KEY allows the user of this key to upload an object to the bucket.
What should I do
1) if I want to go with the API-key way.
2) if I want to go with service-account way. What is the best way to generate Authorisation token? I have come till this point
{"alg":"RS256","typ":"JWT"}.
{
"iss":"761326798069-r5mljlln1rd4lrbhg75efgigp36m78j5#developer.gserviceaccount.com",
"scope":"https://www.googleapis.com/auth/prediction",
"aud":"https://www.googleapis.com/oauth2/v4/token",
"exp":1328554385,
"iat":1328550785
}.
But I am unable to generate {Base64url encoded signature} as I am unable to figure out the private and public keys...
You are getting “anonymous caller” because you are not properly authenticated. You can authenticate using a bearer token instead of the API-KEY.
You can run the following script:
BUCKET=<BUCKET_NAME>
OBJECT=<OBJECT>
TOKEN=$(gcloud auth print-access-token)
curl "https://www.googleapis.com/upload/storage/v1/b/$BUCKET/o?uploadType=media&name=$OBJECT" -H"Authorization: Bearer $TOKEN" -H'Content-Type: image/jpg' --data-binary #$OBJECT

how to upload data to google cloud storage using rest api

I am trying to upload data to google cloud storage using rest api
According to the documentations we can use this api to send data to cloud store
https://www.googleapis.com/upload/storage/v1/b/[Bucket
name]/o?uploadType=media&name=[object name]
and sending auth,content-type and content-length as header
auth can be genereted using service accounts which i generated but still unable to upload the file
i am getting this error
{
"error": {
"errors": [
{
"domain": "global",
"reason": "authError",
"message": "Invalid Credentials",
"locationType": "header",
"location": "Authorization"
}
],
"code": 401,
"message": "Invalid Credentials"
}
}
one of the correct way to do it would be
https://www.googleapis.com/upload/storage/v1/b/[bucket_name]/o?key={your_key}&uploadType=media&name=happy3
you can generate key from api screen in google console
other way is to go to outh2.0 playground and send request from there
it will generate header files accordingly

Cloud foundry API - stop application

I Need API to stop the running application, after some search I've found this API
http://apidocs.cloudfoundry.org/263/apps/updating_an_app.html
if I want to test it with postman how can I obtain token and where should I put it inside postman ?
Edit
i've tried like following with postman
Put
https://[api]/v2/apps/211c82e2-7316-45b6-9ae6-1df4dzz74772/stop
Header
Authorization : bearer <token>
"Content-Type":"application/x-www-form-urlencoded"
I got error:
{
"description": "Unknown request",
"error_code": "CF-NotFound",
"code": 10000
}
Any idea?
To get the token you can run cf oauth-token from the CLI.
You can use that token in Postman by adding an 'Authorization' HTTP header.
E.g.
Authorization: bearer token_you_got_by_running_cf_oauth-token

How to share file with room in HipChat via Postman or Jersey client?

Please provide the solution for this (I am new to jersey and postman). I tried with below link but unable to share the file: https://www.hipchat.com/docs/apiv2/method/share_file_with_room
I attached screen shots, which I tried from postman.
Note: I used API access token with send message scope.
I am getting below error as response:
{
"error": {
"code": 400,
"message": "No file was found in the request. See https://www.hipchat.com/docs/apiv2/method/share_file_with_room for an example",
"type": "Bad Request"
}
}