Discussions

Ask a Question
Back to All

Update Shifts: Internal Server Error

I am having an issue updating a shift in the schedule. This issue can repeated using the live API. Simply enter a valid schedulerID then create and object and enter a valid shiftID along with, say, a new title. After having provided all required parameters, click "Try It!" and observe the response.

{
"details": {
"error_message": "Internal server error",
"error_code": 1000
},
"error": "Internal Server Error",
"path": "/scheduler/v1/schedulers//shifts",
"request_id": "db105255-6581-4ea0-835d-bfad9c1b7f82"
}

Presumably, this should return a success response or a response to indicate a reason as to why the shift title (in this example) cannot be changed.

Admin

Hi there Chris,

I would be happy to assist with that issue.

Please notice that once you're adding an object to the body params there is a new added field '{locationData: {isReferencedToJob: true}}' automatically.

Unfortunately, this small bug is related to our documentation provider and not to our side. The best option right now to avoid this error is to use other API tool (for example Postman) to test those calls and omit the added field stated above.

The live playground on our documentation page is a great choice for 99% of the use cases. This specific request should be executed on a different tool :)

Great, thank you! :)

Just an update, I tried without 'locationData' in the object and got back an error:

"can't set location data if the job location is referenced to true"

Upon further investigation, it would appear that if 'isReferencedToJob' is already set to true in the un-modified shift, this error will be returned from API, no matter what you set/don't set with regards to locationData. To get around this, you have to 'unlock' the location in the shift settings in the UI and republish. Setting 'isReferencedToJob' to false from the API results in internal server error, so you have to do it from the UI.

Admin

Hi Chris,

Can you please provide the payload of the request?

payload = [{
"shiftId": "668efca31cb73611f8f75adb",
"title": "New title"
}]

Admin

Thank you, can you please also provide the request id of in the response error?

Hi Omer,

Here's the response from the above payload:

{'details': {'error_message': 'Request is invalid', 'error_code': 1004}, 'error': "can't set location data if the job location is referenced to true", 'path': '/scheduler/v1/schedulers/7980364/shifts', 'request_id': '02bb632b-8f2d-4f1c-a260-401b7c2a5742'}

If I include isReferencedToJob in the payload and set it to false (to try an mitigate the above error), I get an internal server error.

Admin

In the response provided, it seems you do pass the field isReferencedToJob in the payload. Did you use postman for making the request? For this specific request, it won't be able to make it from our live playground. You can also respond your question in my mail:
omer.vered@connecteam.com

ο»Ώ