Trying to publish pact verification result , Using...
# pactflow
s
Trying to publish pact verification result , Using this doc: https://docs.pact.io/pact_broker/advanced_topics/api_docs/publish_verification_result. We wanted to know which API we have to use from HAL browser.
m
May I ask why you’re using the APIs?
s
To test in postman.
m
I mean what's the use case? What are you trying to do that you can't achieve with pact client libraries now?
s
o inside Java test we use the "au.com.dius.pact.provider.junit5" library and use annotations:_@Provider("TAX")@PactBroker(url = "url")_ This leads to "403 Forbidden" during publishing verification results using our token. Trying manualy to publish the result via Pactflow API we tried using this url as POST:API and this body:
Copy code
{
  "success": true,
  "providerApplicationVersion": "0.0.1"
}
We set our Pactflow read-write Token as Bearer header. This results in the response: Forbidden. Either you are using a read only token for a request that requires a write token (the most likely cause), or you do not have the required permissions.
m
Perhaps you can share how you are setting the token for the java test so we can look? You could also set logs to debug and share the response (it should have a request id in the header). We can look it up to tell you what’s wrong. But the message is pretty clear, so I’m guessing either the wrong token was given to the Java setup, or the setup is incorrect and it’s not flowing into the tool