Python Request Return Access Denied while API Key is valid RRS feed

  • Question

  • Python POST request using requests lib returning following for truck routes api...

    "authenticationResultCode":"InvalidCredentials","brandLogoUri":"http:\/\/\/Branding\/logo_powered_by.png","copyright":"Copyright © 2019 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.","errorDetails":["Access was denied. You may have entered your credentials incorrectly, or you might not have access to the requested resource or operation."],"resourceSets":[],"statusCode":401,"statusDescription":"Unauthorized","traceId":"e45f75f65b94405ca0df5754cb000671|BN000021DC|"

    Thursday, July 11, 2019 6:50 PM

All replies

  • Hi CT_API,

    Please reach out to to confirm your credentials.  You can also get this message if you have a space in front of your key string.



    Thursday, July 11, 2019 6:59 PM
  • Hi IoTGirl,

    Checked and they said the key is active and has the required privileges. They didn't record any attempts to access. No spaces in the key. Get the same response by entering URL manually into browser.

    Any other thoughts?


    Thursday, July 11, 2019 8:43 PM
  • Hi CT_API,

    I have reached out to the Developer Support Team on your behalf and they state:

    "for 401, it is a key issue, but it's can be an issue with the URL somewhere before the key is passed"

    Do you potentially have a special character somewhere in your call? Are you OK providing your call without the key included?



    Thursday, July 11, 2019 8:57 PM
  • There was something wrong with the key (maybe special char (-, _)). Created a new key that authenticates.

    Thursday, July 11, 2019 9:31 PM
  • Great!  I am glad you were able to move forward!  Please remember we are always here to help!
    Thursday, July 11, 2019 10:15 PM