Square V1 api request not working as per API docs -
we experiencing errors few of square apis, working week back, not working per documentation, changed related square, not able find out in news : https://docs.connect.squareup.com/api/connect/v1/?q=employee#navsection-roles & https://docs.connect.squareup.com/api/connect/v1/?q=employee#navsection-employees.
request/response in question.
ex 1: valid role_ids it's failing, used work 3-4 days back.
post https://connect.squareup.com/v1/me/employees http/1.1 host: connect.squareup.com accept: */* authorization: bearer ***************************** content-type: application/json content-length: 120 { "first_name": "first_name_test_sp", "last_name": "last_name_test_sp", "role_ids": ["t6u3cmjnh7ezbalvpfql"] } -- http/1.1 400 bad request x-frame-options: deny x-xss-protection: 1; mode=block x-download-options: noopen x-content-type-options: nosniff x-request-id: v6fctnekqb2p9lspswcs access-control-allow-origin: * access-control-expose-headers: link content-type: application/json; charset=utf-8 vary: accept-encoding x-response-time: 296ms date: fri, 28 jul 2017 07:51:07 gmt keep-alive: timeout=60 strict-transport-security: max-age=631152000 content-length: 74 {"type":"bad_request","message":"role_ids [t6u3cmjnh7ezbalvpfql] invalid"}
ex 2: per api docs, role_ids optional, without failing.
post https://connect.squareup.com/v1/me/employees http/1.1 host: connect.squareup.com accept: */* authorization: bearer ***************************** content-type: application/json content-length: 87 { "first_name": "first_name_test_min_sp", "last_name": "last_name_test_min_sp" } -- http/1.1 400 bad request x-frame-options: deny x-xss-protection: 1; mode=block x-download-options: noopen x-content-type-options: nosniff x-request-id: fjrobtpoq/sqjgljyy+f access-control-allow-origin: * access-control-expose-headers: link content-type: application/json; charset=utf-8 vary: accept-encoding x-response-time: 286ms date: fri, 28 jul 2017 07:51:08 gmt keep-alive: timeout=60 strict-transport-security: max-age=631152000 content-length: 54 {"type":"bad_request","message":"role_ids [] invalid"}
ex 3: permission mandatory creating roles, it's passing.
post https://connect.squareup.com/v1/me/roles http/1.1 host: connect.squareup.com accept: */* authorization: bearer ***************************** content-type: application/json content-length: 71 { "name": "test_name_emptypermissionmin_sp", "permissions": [] } -- http/1.1 200 ok x-frame-options: deny x-xss-protection: 1; mode=block x-download-options: noopen x-content-type-options: nosniff x-request-id: zpvmsdjdqr+kolwm85k/ access-control-allow-origin: * access-control-expose-headers: link content-type: application/json; charset=utf-8 vary: accept-encoding x-response-time: 245ms date: fri, 28 jul 2017 07:51:09 gmt keep-alive: timeout=60 strict-transport-security: max-age=631152000 content-length: 176 {"permissions":[],"id":"pnxpulcufnupifjqnr0y","name":"test_name_emptypermissionmin_sp","is_owner":false,"updated_at":"2017-07-28t07:51:09z","created_at":"2017-07-28t07:51:09z"}
Comments
Post a Comment