enter image description here

While calling a REST API for Azure DevOps I am getting an error 203 Non-Authoritative Information.Actually I want to trigger a release pipeline line with the help of REST API.

3

Best Answer


The 203 error code normally caused by an incorrect PAT format. Looks like you are probably failing authentication because the PAT did not be encoded with base64 correctly.

Ensure the TYPE is Basic Auth, and input the correct PAT format into Password:

enter image description here

Authorization of Postman.

When working with Azure DevOps and using the REST API, you may encounter the HTTP status code 203 Non-Authoritative Information. This status code indicates that the response received from the server may be outdated or incorrect. It means that the server is not the authoritative source for the requested information.

To resolve this issue, you can try several approaches. Firstly, you can check if there are any caching mechanisms in place that may be causing the non-authoritative response. Clearing the cache or disabling caching can help in some cases.

Another solution is to ensure that the request headers are correctly configured. Make sure that the headers include the necessary authentication and authorization information. This ensures that the server recognizes the request as authoritative and provides the correct response.

If the issue persists, you can also try refreshing the data or retrying the request after a certain period of time. Sometimes, the non-authoritative information may be temporary, and a subsequent request may return the authoritative response.

In conclusion, encountering the Azure DevOps 203 Non-Authoritative Information with REST API can be resolved by checking caching mechanisms, configuring request headers correctly, refreshing data, or retrying the request. By following these steps, you can ensure that the server provides the authoritative information you need.

Yes, we are passing the PAT wrongly.

Just another way of doing it, COPY the PAT encode that to base64 manually from a site like - https://www.base64encode.org/

Note - make sure you add ":" as a prefix on PAT and then encode that.

Copy the encoded value to header on Authorization as mentioned -

enter image description here

Hope this will help a few, the only catch was to make sure we add the ":" on the mentioned position.

Edit:
Why to add ":"?It is the separator between the Username and Password. In the Official documentation you can see this pattern where the replacement happens with an empty string. link