• Toly Cernii
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
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.