mindfulsoftware / myFastway.ApiClient

Client for the myFastway API
13 stars 4 forks source link

404 Posting to Contacts #11

Closed geocom closed 5 years ago

geocom commented 5 years ago

I'm having issues with adding a contact no matter what I send I get a 404

Below is the curl command I sent curl -d "{\"displayName\": \"Geoff Evans\",\"contactName\": \"Geoff Evans\",\"phoneNumber\": \"aphonenumber\",\"email\": \"aemailaddress\",\"address\": {\"streetAddress\": \"astreetnumberandaddress\",\"additionalDetails\": \"\",\"locality\": \"Auckland\",\"stateOrProvince\": \"Avondale\",\"postalCode\": \"1026\",\"country\": \"New Zealand\" }}" https://api.myfastway.co.nz/api/contacts.json --verbose -H "Authorization: Bearer ...."

Gives the response

  • Trying 103.61.69.116...

  • TCP_NODELAY set

  • Connected to api.myfastway.co.nz (103.61.69.116) port 443 (#0)

  • ALPN, offering h2

  • ALPN, offering http/1.1

  • Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH

  • successfully set certificate verify locations:

  • CAfile: /etc/ssl/cert.pem CApath: none

  • TLSv1.2 (OUT), TLS handshake, Client hello (1):

  • TLSv1.2 (IN), TLS handshake, Server hello (2):

  • TLSv1.2 (IN), TLS handshake, Certificate (11):

  • TLSv1.2 (IN), TLS handshake, Server key exchange (12):

  • TLSv1.2 (IN), TLS handshake, Server finished (14):

  • TLSv1.2 (OUT), TLS handshake, Client key exchange (16):

  • TLSv1.2 (OUT), TLS change cipher, Client hello (1):

  • TLSv1.2 (OUT), TLS handshake, Finished (20):

  • TLSv1.2 (IN), TLS change cipher, Client hello (1):

  • TLSv1.2 (IN), TLS handshake, Finished (20):

  • SSL connection using TLSv1.2 / ECDHE-RSA-AES256-SHA384

  • ALPN, server did not agree to a protocol

  • Server certificate:

  • subject: CN=*.myfastway.co.nz; O=Australian Couriers Pty Ltd; L=Sydney; ST=New South Wales; C=AU

  • start date: Aug 9 00:17:24 2018 GMT

  • expire date: Aug 10 06:17:24 2020 GMT

  • subjectAltName: host "api.myfastway.co.nz" matched cert's "*.myfastway.co.nz"

  • issuer: C=US; ST=Illinois; L=Chicago; O=Trustwave Holdings, Inc.; CN=Trustwave Organization Validation SHA256 CA, Level 1; emailAddress=ca@trustwave.com

  • SSL certificate verify ok.

    POST /api/contacts.json HTTP/1.1 Host: api.myfastway.co.nz User-Agent: curl/7.54.0 Accept: / Authorization: Bearer eyJhbGciOiJSU.... Content-Length: 0 Content-Type: application/x-www-form-urlencoded

    < HTTP/1.1 404 Not Found < Server: Kestrel < Date: Fri, 04 Oct 2019 04:34:49 GMT < Content-Length: 0

  • HTTP error before end of send, stop sending <

  • Closing connection 0

  • TLSv1.2 (OUT), TLS alert, Client hello (1):

Am I missing something or is the routing broken server side?

mindfulsoftware commented 5 years ago

are you appending .json to the end of the url? e.g. https://api.myfastway.co.nz/api/contacts.json should be https://api.myfastway.co.nz/api/contacts

geocom commented 5 years ago

Thanks could have sworn I was getting 404 with just contacts and contacts.json but now it is working correctly with https://api.myfastway.co.nz/api/contacts