Git Product home page Git Product logo

Comments (12)

PiyushGuptaMSFT avatar PiyushGuptaMSFT commented on August 20, 2024 2

@abettadapur Just to add on, if you want to retrieve your id, you can use the connectionData api https://app.vssps.visualstudio.com/_apis/ConnectionData, to get your id, and then called the https://app.vssps.visualstudio.com/_apis/accounts?ownerId={ownerId}&api-version={api-version}, to find the accounts associated with the id. This is the recommended way to use List Accounts API, as you will get the concise account object in response.

from vsts-rest-api-specs.

GrillPhil avatar GrillPhil commented on August 20, 2024 1

Using https://app.vssps.visualstudio.com I do get a 400 response saying "Necessary parameters ownerId or memberId were not provided in the request." Now I wonder how can I retrieve my member Id through the REST Api in order to construct this request?

from vsts-rest-api-specs.

abettadapur avatar abettadapur commented on August 20, 2024 1

@PiyushGuptaMSFT Additionally, I cannot use my PAT to call this API. The same PAT works correctly on the other account scoped APIs

from vsts-rest-api-specs.

wnjenkin avatar wnjenkin commented on August 20, 2024

Thank you for your feedback. We're actively working on a fix for this now.

from vsts-rest-api-specs.

tedchamb avatar tedchamb commented on August 20, 2024

@abettadapur To unblock you until the docs get updated, the correct host is
https://app.vssps.visualstudio.com rather than https://{accountName}.visualstudio.com

from vsts-rest-api-specs.

PiyushGuptaMSFT avatar PiyushGuptaMSFT commented on August 20, 2024

@abettadapur Apologies for the inconvenience caused to you. Are you using https://app.vssps.visualstudio.com/_apis/accounts? The correct URI is https://app.vssps.visualstudio.com/_apis/accounts, however if you still getting an error using this, then please let us know.

from vsts-rest-api-specs.

abettadapur avatar abettadapur commented on August 20, 2024

Yes that API is working for me, thanks

from vsts-rest-api-specs.

PiyushGuptaMSFT avatar PiyushGuptaMSFT commented on August 20, 2024

@abettadapur Currently, PAT creation is scoped to accounts, and hence it is not possible to call an deployment level API via PAT.

from vsts-rest-api-specs.

crpietschmann avatar crpietschmann commented on August 20, 2024

I can call "_apis/ConnectionData" and pass the PAT for success. However, no matter what I do when I call "_apis/accounts" it ALWAYS returns 401 Unauthorized... Is the API broken?

FYI, I'm using Postman right now to do the calls. Will write code once I get the right calls working...

from vsts-rest-api-specs.

crpietschmann avatar crpietschmann commented on August 20, 2024

@abettadapur Currently, PAT creation is scoped to accounts, and hence it is not possible to call an deployment level API via PAT.

How can we make an API call to get a list of the Accounts / Organizations the current user has access to in Azure DevOps, if the PAT wont work with "_apis/accounts"??

from vsts-rest-api-specs.

and-megan avatar and-megan commented on August 20, 2024

Using https://app.vssps.visualstudio.com/_apis/accounts I get the "Necessary parameters ownerId or memberId were not provided in the request." response. I am using an OAuth token. I am using version 5.0 of the AzureDevops REST API.

from vsts-rest-api-specs.

matejskubic avatar matejskubic commented on August 20, 2024

@PiyushGuptaMSFT any news on this?
Request https://app.vssps.visualstudio.com/_apis/accounts?api-version=7.2-preview
still returns

{
  "$id": "1",
  "innerException": null,
  "message": "Necessary parameters ownerId or memberId were not provided in the request.",
  "typeName": "Microsoft.VisualStudio.Services.Account.AccountException, Microsoft.VisualStudio.Services.WebApi",
  "typeKey": "AccountException",
  "errorCode": 0,
  "eventId": 4236
}

from vsts-rest-api-specs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.