invalid_response_type when trying to do server-to-server auth

invalid_response_type when trying to do server-to-server auth

Following the guide at https://www.zoho.com/crm/developer/docs/api/v2/self-oauth.html

and I make the following request with `axios` via nodejs:


{

  url: 'https://accounts.zoho.com/oauth/v2/token/self/authtooauth',

  method: 'POST',

  data: {

    client_id: '1000.790EWJK06E04Y2DYNGTXDNMNF2UIZH',

    client_secret: '8df118a0b9a6414bb2968bc50012c7b9fa131761f1',

    grant_type: 'authtooauth',

    authtoken: '1000.40e22f82bfac8a539c77b1990c6bedc0.5750d676c852ca143a9fd53a633651d4',

    scope: 'ZohoCRM.modules.ALL,ZohoCRM.settings.ALL',

    soid: 'ZohoCRM.763993401'

  },

  headers: {}

}


However, no matter what `data` props I pass, I get the following result:


{ error: 'invalid_response_type' }


The only mention of this error online is https://help.zoho.com/portal/en/community/topic/auth-to-oauth-returns-invalid-response-type

and that was posted 6 months ago with no response.


What should I do? I need to write server-to-server code to keep my company's data in sync with Zoho - not user-OAuth flow, but server-to-server. The docs only have this (https://www.zoho.com/crm/developer/docs/api/v2/self-oauth.html) to follow, and  don't even mention the API console (https://api-console.zoho.com/client/1000.790EWJK06E04Y2DYNGTXDNMNF2UIZH) that I needed to use to get the token.


So...how do I do server-to-server auth -- or -- what am I doing wrong above?