Skip to main content
Challenge ⌗3

After a number of mis-starts, I have passed this challenge. However, I am not convinced that my code is doing what it should (or anything!).

If I don't specifiy the full https path in my callout (and just use the named credential as I beleive I should) I get an unathorized error:

14:28:29:005 CALLOUT_REQUEST [24]|System.HttpRequest[Endpoint=callout:ProjectService, Method=POST]

14:28:29:348 CALLOUT_RESPONSE [24]|System.HttpResponse[Status=Unauthorized, StatusCode=401]

The details in the named credential appear fine (I can use them and login manually).

If I include the URL in the callout (!!!?), I appear to authorize ok - however the response 'Not Found' is the same result I get if I connect to the site and logon manually:

13:36:08:006 CALLOUT_REQUEST [24]|System.HttpRequest[Endpoint=callout:ProjectService/https://sb-integration-pms.herokuapp.com/projects, Method=POST]

13:36:08:393 CALLOUT_RESPONSE [24]|System.HttpResponse[Status=Not Found, StatusCode=404]

I'm sure I'm doing something silly here but can't spot it. 

BTW

I also passed the challenge with no code to change the opportunity stage to submitted project/resubmit project. This doesn't matter but building this code does make repeated tests faster.
17 respuestas
  1. 21 abr 2024, 17:50

    I am also getting the following error when trying to call Heroku.  

    System.HttpResponse[Status=Internal Server Error, StatusCode=500]

    I have tried setting up the Named Credentials and External Credential multiple times and the same result occurs.  I took the advice of moving on to the next exercise and that also didn't resolve the issue.  I set up a similar API call in real life last week and the 'Authentication Settings for an External System' setup entry isn't available in the playground.  Any ideas?  I've checked against other posts and nothing has resolved this.  I've also opened a case with not response so far.  

0/9000