501 error for PATCH request to core/company/{companyid}

felixfelix Member Posts: 3
edited April 4 in Development

I am implementing an integration between our PMS system and your POS.

I am running into an issue with the PATCH request to set the api credentials in the company settings (path /core/company/{companyId})

I get a 501 error from you. Please advice.


Here your response:

HTTP/1.1 501 Method PATCH is not defined in RFC 2068 and is not supported by the Servlet API 

Date: Thu, 04 Apr 2019 19:18:44 GMT

Content-Length: 0

Connection: close

Set-Cookie: __cfduid=dba3ea71a2ed0f5f1fb2faf72c161a3851554405524; expires=Fri, 03-Apr-20 19:18:44 GMT; path=/; domain=.posios.com; HttpOnly

Access-Control-Allow-Credentials: true

Access-Control-Allow-Methods: POST, PUT, PATCH, GET, OPTIONS, DELETE

Access-Control-Max-Age: 3600

Access-Control-Allow-Headers: x-auth-token, x-requested-with, content-type

Expect-CT: max-age=604800, report-uri="https://report-uri.cloudflare.com/cdn-cgi/beacon/expect-ct"

Server: cloudflare

CF-RAY: 4c25a13d680254fe-ORD


Here my request:

PATCH /PosServer/core/company/14754 HTTP/1.0

Host: staging-integration.posios.com

User-Agent: Drupal (+http://drupal.org/)

Content-Length: 258

Content-Type: application/json

Accept: */*

X-Auth-Token: {REDACTED}


{"0":{"op":"replace","path":"/genericPmsApiUser","value":"xxxxxx"},"1":{"op":"replace","path":"/genericPmsApiPassword","value":"xxxxx"},"2":{"op":"replace","path":"/genericPmsApiUrl","value":"https://www.domain.com/calmlakeinn/pos/lightspeed"}}

Post edited by Michael Carey on

Answers

  • Michael CareyMichael Carey Administrator, Lightspeed Staff Posts: 68 moderator

    Hi Felix,

    Could you please try again using the following payload format:

    {"operations": [
     {
      "op": "replace",
      "path": "/genericPmsApiUrl",
      "value": 
        "https://www.domain.com/calmlakeinn/pos/lightspeed"
     },
     {
      "op": "replace",
      "path": "/genericPmsApiUser",
      "value": "xxxxxx"
     },
     {
      "op": "replace",
      "path": "/genericPmsApiPassword",
      "value": "yyyyyyy"
     }
    ]}
    
    Michael Carey

    Product Manager
    Lightspeed HQ
  • felixfelix Member Posts: 3

    Sorry, I should have seen that it is the wrong format. But in any case, I still get the same error response.

    here my corrected request:

    PATCH /PosServer/core/company/14754 HTTP/1.0

    Host: staging-integration.posios.com

    User-Agent: Drupal (+http://drupal.org/)

    Content-Length: 261

    Content-Type: application/json

    Accept: */*

    X-Auth-Token: eyJhbGciOiJIUzI1NiJ9.eyJhdWQiOiJwYXJ0bmVyX3VzZXIiLCJzZXJ2ZXIiOiJzdGFnaW5nLWludGVncmF0aW9uLnBvc2lvcy5jb20iLCJzdWIiOiIyNDg5MyIsImlzcyI6IjE0NzU0IiwidGFyZ2V0VXNlcklkIjoyNDg5MywiZXhwIjoxNTU0NDI0MzE1LCJkaWQiOiJJS0FhcGkiLCJjaWQiOjE0NzU0fQ.__jSlydTNGC84HMjTLjbSEE6Hi6jDp98iNYOMCvFCPU


    {"operations":[{"op":"replace","path":"/genericPmsApiUser","value":"posapi"},{"op":"replace","path":"/genericPmsApiPassword","value":"posapi"},{"op":"replace","path":"/genericPmsApiUrl","value":"https://www.domain.com/calmlakeinn/pos/lightspeed"}]}

  • felixfelix Member Posts: 3

    Michael,

    I apologize. I used the wrong url. It should have been "rest/core/company" instead of "core/company"

    Felix

  • Michael CareyMichael Carey Administrator, Lightspeed Staff Posts: 68 moderator

    Hi Felix,

    I'm glad you got it sorted out. Take care!

    Michael Carey

    Product Manager
    Lightspeed HQ
  • KrijneneSolutionsKrijneneSolutions Member Posts: 46

    Maandag morgen; zoveelste keer problemen met downloaden pakbonnen, foutmeldingen, mislukte verbinding GRRRR @lightspeed

Sign In or Register to comment.