This seems to be code for an API call. Have you tested this in postman or with the API connector?