Data Compliance returns invalid_request 400

Description
I am trying to post data compliance after receiving the deauthorization event payload. I am following the instructions from these documents:

POST /auth/data/compliance
Data Compliance

Error
The request returns this:

{"reason":"Invalid Request","error":"invalid_request"}

Which App Type (OAuth / Chatbot / JWT / Webhook)?
OAuth

Which Endpoint/s?
Data Compliance API

How To Reproduce (If applicable)
I send POST to the URL that was in the document

client_id = ENV['ZOOM_APP_KEY']
client_secret = ENV['ZOOM_APP_SECRET']
headers_secret = Base64.strict_encode64("#{client_id}:#{client_secret}")

deauthorization_event = ZoomDeauthorizationEvent.find(deauthorization_event_id)

data_compliance_link = "https://api.zoom.us/oauth/data/compliance"

response = HTTParty.post(
  data_compliance_link,
  body: {
    "client_id": deauthorization_event.client_id,
    "user_id": deauthorization_event.user_id,
    "account_id": deauthorization_event.account_id,
    "deauthorization_event_received":  {
      "user_data_retention": deauthorization_event.user_data_retention,
      "account_id": deauthorization_event.account_id,
      "user_id": deauthorization_event.user_id,
      "signature": deauthorization_event.signature,
      "deauthorization_time": deauthorization_event.deauthorization_time,
      "client_id": deauthorization_event.client_id
    },
    "compliance_completed": true
  }.to_json,
  headers: { 
    "Authorization": "Basic #{headers_secret}",
    "Content-Type": "application/json",
    "cache-control": "no-cache"
  }
)

I am getting 400 response.code

Additional context
I am testing through ngrok, with production credentials provided by ZOOM.

I read all the posts from here, and it often seems like header problems (misspelling, etc)

Hey @Thrive,

Thank you for reaching out to the Zoom Developer Forum. Please send an email including the endpoint, request body and headers that are used to reproduce the issue to developersupport@zoom.us and we’ll look into this further.

Thanks,
Max

Thanks @MaxM,

The compliance endpoint returned 200 and I was able to get the response body.

It might have been the base64 not working correctly on my end. In any case, it started working.

1 Like

Hey Thrive,

Thank you for the update. I’m glad to hear that you resolved your issue! If you have any further issues or questions, please don’t hesitate to reach out.

Thanks,
Max

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.