Forum Discussion

IhebKharab's avatar
IhebKharab
Frequent Visitor
2 years ago

We could not authenticate with the credentials provided

Hello everyone, 

I am trying to get data from an atlassian marketplace REST API with POST request: 
I have the following query: 

 

 

let
url = "https://marketplace.atlassian.com/rest/2/vendors/...",
body = "{...}",
token = "username:token",
header = [
#"Content-type" = "application/json",
#"Accept" = "application/json",
#"Authorization" = "Basic"& token],
response = Web.Contents(url, [Headers = header], [Content = Text.ToBinary(body)]),
AccessToken = Json.Document(response)[access_token],
JsonResponse = Web.Contents(url, [Headers =[ #"Content-type" = "application/json", #"Accept" = "application/json", #"Authorization" = "Basic"& token], Content = Text.ToBinary(body)]),
Result = Json.Document(JsonResponse)
in
Result

 

 

I have also set the source credentials to Annonymous because if not, I cannot use Web.Contents and if i remove Web.contents and use basic credentials I get the error that data of type record cannot be converted into number. 

 

Does anyone has a suggeston? 🙂 I have went through a lot of community answers about such topic, but unfortunately without sucess! 

Thank you already in advance and have a nice day. 

Kind regards, 

Iheb Kharab

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi IhebKharab 

    You can try to get the url by select web resource

     

    Then select authenticate by Anonymous

    Best Regards!

    Yolo Zhu

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

     

     

    • IhebKharab's avatar
      IhebKharab
      Frequent Visitor

      Hi Anonymous, 

       

      Thank you for your reply, but I have chosen web as source and the authentication does not go through for annonymous. 

       

      Kind regards, 

      Iheb