
Tim J (Veracode PM) (Veracode) asked a question.
Hi all! As previously promised, we've published "how to" guidance for how to use the Identity API in the Veracode Help Center. This should hopefully make it easier to learn how to use the Identity API to manage users, teams, business units, and API credentials. In the interim, we've used questions posted here in the community to make the how to guidance better, so keep the questions and feedback coming!
.png)
This is awesome Tim!!! 😀
what a welcome sight
This is an excellent resource. Most notably, it contains the correct information whereas the SwaggerHub documentation does not.
Specifically, the Help Center article linked above says to use "POST" to update a User on the Identity API; SwaggerHub documentation (https://app.swaggerhub.com/apis/Veracode/veracode-identity_api/1.0#/user/updateUserUsingPUT_1) says to use "PUT" which always returns an empty 500 error.
Sorry, the earlier message was premature. The "empty 500" problem comes from an incomplete header specification on my end.
Plus a retraction, as, actually, the example on the Veracode Help Center article is incorrect and Swagger/JSON documentation is correct.
PUT is used with a unique endpoint (e.g. .../users/GUID) to update an existing user.
The example shown at https://help.veracode.com/r/c_identity_update_user under the heading "Updating a User with the Identity API" is actually for creating a new user via POST at the generic endpoint (e.g. .../users) - and appears to be a partial copy/past error from content in the earlier Create topic (at https://help.veracode.com/r/c_identity_create_human).
An update to this thread. 500 errors from the Identity API are often the result of not supplying the 'roles' section in the JSON body of the request. Ideally, this should result in a 400 error indicating such.
See details on this other posting: https://community.veracode.com/s/question/0D53n00007bbT4VCAU/problems-creating-a-user-with-the-identity-rest-api
Hi @rich.steenwyk (Community Member) -- thank you for flagging this! I will file a bug ticket and we'll get the documentation updated.
FWIW the correct example in this case is
http --auth-type=veracode_hmac PUT "https://api.veracode.com/api/authn/v2/users/<guid>?partial=true" < input.json
The partial=true is important because it allows you to specify only the fields you want to change.
Note: the link for this help resource was changed. The correct link is https://help.veracode.com/r/orRWez4I0tnZNaA_i0zn9g/tKiWK4nKXfBayXj~eMgv0Q