Using Curl in a batch task to POST

I am trying to use Curl in a batch task to send in a claim. my line is:

curl --cert nzhealthca.pem -d @test1.txt https://provider.api-compliance.acc.co.nz/api/v2/claims --header "Accept-Encoding: gzip,deflate&key: xxxxxxx&Content-Type: application/json&Content-Length: 1507&Host: provider.api-compliance.acc.co.nz&Connection: Keep-Alive&User-Agent: Apache-HttpClient/4.1.1 (java 1.5)"

It keeps giving the fault "Failed to resolve ApI Key variable request.header.apikey" (which I've replace above with 'xxxxx').

I'm new to this, so would appreciate any assistance.

Thanks

Dave Johnston

Greetings Dave

Give this a try:

curl --cert nzhealthca.pem -d @test1.txt https://provider.api-compliance.acc.co.nz/api/v2/claims --header "Accept-Encoding: gzip,deflate&apikey: xxxxxxx&Content-Type: application/json&Content-Length: 1507&Host: provider.api-compliance.acc.co.nz&Connection: Keep-Alive&User-Agent: Apache-HttpClient/4.1.1 (java 1.5)"





Cheers.
Steven
 


Interestingly it is an identical response. I tried bringing the key in after the Certificate - with '--apikey' Curl faults, and with '--key' I get exactly the same error of the apikey. It's as if the key is being totally ignored.


I made the key 'xxxxx' and got the same response. So for some reason the key value is being totally ignored by the ACC site.


Maybe this might work:

 

curl --cert nzhealthca.pem -d @test1.txt https://provider.api-compliance.acc.co.nz/api/v2/claims --header "Accept-Encoding: gzip,deflate&apikey: xxxxxxx&Content-Length: 1507&Host: provider.api-compliance.acc.co.nz&Connection: Keep-Alive&User-Agent: Apache-HttpClient/4.1.1 (java 1.5)"

 

Leon


Exactly the same response I'm afraid. I've moved it to just after the certificate as --key and it responds just the same. It is as if it doesn't see the key at all.


I made it 'apikey:' as you suggested. But I also moved that bit to the very beginning of the header. Now I get 'Invalid API Key'. Though it is definitely my API Key for this. Not sure if that is an improvement or not. Any ideas?
Thanks


Hi Dave

I've made a change on my end. Can you try again?

Cheers.
Steven


Now I get 'Invalid API Key'. I am getting this error how to resolve this.


Can you provide us which app you are using when this error comes up? Also which endpoint you are trying to aim?

 

Thanks

 

Leon


Hi Leon ,       

     Created New App   MyApps -> Query Invoice Compliance     

   Scenario:  Query Invoices -> Invoices/list_of_submissions in the portal.

           After the using the API  key given in the ACC Developer portal getting the below error.

           { "code": 401, "reason": "The API Key is not valid for this resource" }

 

 


Thanks for telling us this. Your procedures looks fine, so we need the following information so that I can indentify and adjust in our backend:

  1. Your App's name
  2. Your API Key last 6 characters
  3. When did you create this app
  4. The endpoint URL you are querying from

Or you can try use the API key that you are submit the invoice, it should be also work for query the invoice.

Thanks,

Leon


App Name: Query Invoice

API Key: TuPql1

Created Date:Wed, 14/11/2018 - 21:36

End Point URL:https://provider.api-compliance.acc.co.nz/api/v2/claims/vendors/submissions


Thanks for provide us those info. I've tested your API Key and it works fine on my end. But I also adjusted some changes in your app, so can you please give it another try, and make sure you include your API Key in the header of your submission.

Thanks

Leon