0

I am following this doc for reference. I am able to get information for secure gateway, which is already created. But when I am trying to create a new secure gateway from the REST API, it is asking for authentication. I have tried to provide the authentication information two ways:

  • I have provided the oauth authorization header obtained from the cf oauth-token, but it gives me an unauthorized error.
  • I have given basic authentication (username and password of the Bluemix account) information, but it gives me an unauthorized error.

Note: I am using postman for this operation

Postman details:

url: https://sgmanager.au-syd.bluemix.net/v1/[email protected]&space_id=Equxxxxx

enter image description here

It is also saying "Invalid org_id", but the org_id is valid.

5
  • Could you add details on the API call and the error? Commented Jun 14, 2017 at 11:00
  • I have updated my question. Commented Jun 14, 2017 at 11:12
  • IMHO the org_id should be the guid. You can obtain it on the command line via cf org yourOrgName --guid. Commented Jun 14, 2017 at 11:48
  • @data_henrik Its worked. Thanks! Commented Jun 14, 2017 at 13:37
  • For space guid cf space yourSpaceName --guid Commented Jun 14, 2017 at 13:38

1 Answer 1

1

To create a gateway via the SG API, your request will need the query parameters ord_id and space_id (the guids, not the friendly names). The authorization header will be Basic <your_base64_encoded_username:password> or Bearer <bluemix_token>. For example:

curl "https://sgmanager.au-syd.bluemix.net/v1/sgconfig?org_id=myOrgGuid&space_id=mySpaceGuid" -H "Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=" -d '{"desc":"My Gateway"}'
Sign up to request clarification or add additional context in comments.

1 Comment

Worked For me Thanks!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.