After all the effort you guys are putting in to help with this question, I really hope it is not something obvious that I have missed. Gonne feel pretty stupid if it is LOL.
Version of JIWA: 7.2.1
Version REST API: 7.2.1.0
"Are there any other plugins adding custom routes or behaviors to the api?"
Yes, several. I have checked all of the names and ensured there is no duplicates.
Is there something else I should check?
"Can you also confirm that there is a views directory under the Jiwa program directory and what its contents is?"
Yes. Contents are:
LoginGetRequest.cshtml (Last modified 17/07/2019)
SalesOrderGETRequest.cshtml (Last modified 17/07/2019)
"I would also try removing ngrok from the equation temporarily and see what happens when you use localhost."
Same thing happened.
"If I were troubleshooting this, the first thing I would do is disable that plugin and try again."
Same thing happened.
"rename the Views folder under your Jiwa Installation folder,"
Same thing happened.
"If you are authenticating in a previous request, then you need to pass the session id in the request header for your POST to Webhooks/Subscribers. Are you doing that? "
Yes, authentication does not seem to be a problem when I am using CURL. Only when using POSTMAN or putting params directly into URL and it trys to redirect.
I can set CURL to redirect, but it has already sent the request and replied before redirecting, so does not seem to be any benefit in doing that.
"Would be good if you could show the whole raw request."
Sent values:
https://*****.ngrok.io/Webhooks/Subscribers/$headerArr = array(
'Accept'=>'application/json',
'jiwa-stateful'=>'false',
'Authorization: Bearer '.JIWA_API_KEY,
"ss-id:".$this->JIWA_SESS_ID
);
curl_setopt($this->CURL_OBJ, CURLOPT_POSTFIELDS, "Name=".$SUBSCRIBER_NAME."&IsEnabled=true&apikey=".JIWA_API_KEY);
Returned reply header:
array(37) {
["url"]=>
string(47) "https://7ct27hqz.ngrok.io/Webhooks/Subscribers/"
["content_type"]=>
string(31) "application/json; charset=utf-8"
["http_code"]=>
int(200)
["header_size"]=>
int(342)
["request_size"]=>
int(1041)
etc etc
Reply body:
array(2) {
["Results"]=>
array(0) {
}
["Meta"]=>
array(0) {
}
}
Probably something that is staring me right in the face, but I just cant figure it out.
Thanks for all your help.
Cheers