knocklabs / knock-node

Official Node SDK for interacting with the Knock API
MIT License
40 stars 5 forks source link

`await knock.workflows.deleteSchedules` doesn’t work #52

Open heymartinadams opened 9 months ago

heymartinadams commented 9 months ago

Attempting to delete schedules.

const invalidScheduleIds = ['2bT9UKxmLDRz1RqN6rYygLDvXBz']

await knock.workflows.deleteSchedules({ schedule_ids: invalidScheduleIds })

provides the following error:

⨯ [UnprocessableEntityException: The following errors occurred:
    schedule_ids(cast): is invalid
]
heymartinadams commented 9 months ago

Honestly, this error message isn’t much better than the previous one https://github.com/knocklabs/knock-node/issues/47#issue-2094700979: it doesn’t mean anything to me.

UnprocessableEntityException {
  requestID: 'F64GkhZ2i23oT8oEHBSh',
  status: 422,
  name: 'UnprocessableEntityException',
  message: 'The following errors occurred:\n\tschedule_ids(cast): is invalid\n'
}
Namaskar-1F64F commented 7 months ago

@heymartinadams updating might work for ya.

I had a similar message with deleteSubscriptions

'The following errors occurred:\n\trecipients(embed): is invalid\n'

and it was fixed by updating the package. was on 6.1, now 6.5

guessing it was this headers change which puts application/json on all reqs

cheers

heymartinadams commented 7 months ago

Thank you @Namaskar-1F64F! ✨