Forum Discussion

Priyadharshini2205's avatar
Priyadharshini2205
Copper Contributor
May 24, 2021

Error while using Add comments API Request

Tried to create a new comment for work item in Azure devops with the help of Add comments API using postman. But the request failed to create the comment and I end up with Error message. The error "TF400898: An Internal Error Occurred"
 
Method: POST
Header : 
Content-Type : application/json-patch+json
body:
[
  {
    "text""Hai from priya"
  }
]
 
Authorization :
Basic Auth
username :
password :uxi5azhzg7wvvcgrr4b32q7tj2liocca4tejc3276wed73rqytyq
 
ERROR message:
{
    "$id""1",
    "innerException"null,
    "message""TF400898: An Internal Error Occurred. Activity Id: 44b4cc77-b9a9-4b30-90d6-f2089b561846.",
    "typeName""System.Web.Http.HttpResponseException, System.Web.Http",
    "typeKey""HttpResponseException",
    "errorCode"0,
    "eventId"0
}
  • perspolis's avatar
    perspolis
    Copper Contributor

    Priyadharshini2205 

    You need to use object not array of object for body and change content-type to application/json

     

     

    Header : 
    Content-Type : application/json
    body:
      {
        "text""Hai from priya"
      }
  • mohammedmubeen's avatar
    mohammedmubeen
    Copper Contributor
    Your Basic Auth header should be formatted as:
    Authorization: Basic {Base64-encoded-string}