0

I'm following the cert manager documentation but cannot seem to successfully run the curl commands. The doc gives an example regarding how to retrieve a list of certs:

curl -H "Authorization: Bearer IAM-token" https://api-endpoint/api/v2/URLencodedCRN-basedinstanceId/certificates/

I have substituted my IAM-token, my api-endpoint as eu-gb.certificate-manager.cloud.ibm.com and my CRN but I get the following error:

Cannot GET /api/v2/mycrn/certificates/

Any idea what I could be doing wrong here? Thanks.

Louise
  • 3
  • 1
  • Please provide a full example of the cURL you're sending. In all likelihood you did not URL encode the instance CRN. – Idan Adar Mar 05 '19 at 14:11

1 Answers1

0

You can use the service's Swagger UI to test a request and see how the cURL request should look like.

In all likelihood you did not URL encode the instance CRN.

Swagger UI: https://eu-gb.certificate-manager.cloud.ibm.com/docs/#/Certificates_Repository/list

Service ID (decoded):

crn:v1:bluemix:public:cloudcerts:eu-gb:a/eff54442111ad670345651f3d69d6ed:1f1ac62e-85ee-4da9-8e3a-f30a80918843::

Service ID (encoded):

crn%3Av1%3Abluemix%3Apublic%3Acloudcerts%3Aeu-gb%3Aa%2Feff54442111ad670345651f3d69d6ed%3A1f1ac62e-85ee-4da9-8e3a-f30a80918843%3A%3A

Full request:

curl -X GET "https://eu-gb.certificate-manager.cloud.ibm.com/api/v3/crn%3Av1%3Abluemix%3Apublic%3Acloudcerts%3Aeu-gb%3Aa%2Feff54442111ad670345651f3d69d6ed%3A1f1ac62e-85ee-4da9-8e3a-f30a80918843%3A%3A/certificates" -H "accept: application/json" -H "Authorization: Bearer [IAM TOKEN]"

You should also use v3 instead of v2 as this API endpoint version is deprecated.

Idan Adar
  • 44,156
  • 13
  • 50
  • 89
  • 1
    Thank you very much for your help! Turns out I just needed to encode the crn. – Louise Mar 05 '19 at 16:41
  • Idan - for the API that returns a certificate: `https://us-south.certificate-manager.cloud.ibm.com/api/v2/certificate/crn.....` I have to use `v2` as `v3` returns a 500 server error. Is there a link where I can post this bug/issue? – John Hanley Nov 11 '19 at 23:37
  • Also, the Swagger UI link in your answer no longer works. Is there an update? A Google search does not find anything. – John Hanley Nov 11 '19 at 23:49
  • Hi @JohnHanley the swagger URL loaded fine for me? I cannot confirm either about v3 API endpoint. Please reach us via IBM Cloud support center if you have any specific questions. – Idan Adar Nov 12 '19 at 10:55
  • The link in your answer is broken for me "Error 524" from Cloudflare. I did send an email to IBM. I received a reply that I need to contact the appropriate group. I don't know the appropriate group. – John Hanley Nov 12 '19 at 14:47
  • Certificate Manager (or internally "cloudcerts"). I tried the link again and it's still working, maybe try in a private window? – Idan Adar Nov 12 '19 at 14:54