Skip Navigation LinksHome Page > Forums > SpiraPlan Forums > SpiraPlan Issues & Questi... > REST API - Requirement Te...
I am trying to connect testcases to requirements, using the post API: https://api.inflectra.com/spira/services/v6_0/RestServiceOperation.aspx?uri=projects%2f%7bproject_id%7d%2frequirements%2ftest-steps&method=POST
The call itself is succesfull but test coverage / requirement coverage in spiraplan remain empty.
Using the association Post API can link them but this is not used in test coverage: https://api.inflectra.com/spira/services/v6_0/RestServiceOperation.aspx?uri=projects%2f%7bproject_id%7d%2fassociations&method=POST
Is there some issue with the API call or perhaps a prerequisite im missing? The API calls are done from c# using HttpClient.
I think you are using the wrong endpoint. You are using the Requirement -> Test Steps one, not test cases.
Please use this one:
https://api.inflectra.com/Spira/Services/v6_0/RestServiceOperation.aspx?uri=projects%2f%7bproject_id%7d%2frequirements%2ftest-cases&method=POST
Ah sorry my mistake, I copied the wrong link I am indeed using https://api.inflectra.com/Spira/Services/v6_0/RestServiceOperation.aspx?uri=projects%2f%7bproject_id%7d%2frequirements%2ftest-cases&method=POST
OK then please log a support ticket with the exact payload you are using:
https://www.inflectra.com/Support/Ticket/List.aspx
Thanks for the help, I made a ticket and got the answer.
It seems the postasjsonasync method of the httpclient in c# sets the content-type to "text/html", which caused the issue. After making sure the content-type is set to "application/json" it works.
And if you have any questions, please email or call us at +1 (202) 558-6885