Apple Device Check API 'Missing or incorrectly formatted device token payload'

We are using apple's device check api to prevent fraud happening for our app. As per tutorial, on client we added code to get ephemeral token and converted it to base64 string to send it to our server. Now when our backend queries the state of the device with Apple with fresh ephemeral token from device we get response as 'Missing or incorrectly formatted device token payload'.

Can you please let us know what wrong we are doing? Also please let me know if you need any information.