Wix Fetch + Zoho CRM API v2 - Anyone?

Hi everyone,

I need to call Zoho CRM API v2, to get new contacts records at every 30 min. I setup successfully the scheduled jobs on wix but I’m stuck with Zoho API consumer.

Anyone already had this especific mix involving Wix Fetch + Zoho CRM API?

Tanks

Looks like nobody has any exp. Could you elaborate a bit about the problem you´re having, including any code you can provide?

At the moment I’m trying babysteps process…

Using PostMan to check de API CALL, everything works fine. But, on WIX I can’t do the basics, l ike use my refresh_token to get a new access_token.

{
“error”: “invalid_client”
}

import {fetch, getJSON} from 'wix-fetch';

export async function refreshToken(){
 const headers = {
 'refresh_token' : refresh_token,
 'client_id': client_id,
 'client_secret': client_secret,
 'grant_type': `refresh_token`
    }
 return await request(url_refresh, "post", headers, "");

}


/**
 * A private method to perform an HTTP Fetch request towards an API
 * NOTE: This method is not exposed via `export`
 *
 * @param {string} url - API endpoint
 * @param {string} method - 'get' or 'post'
 * @param {Object} data - the data in form of one-level-deep object dictionary
 * @returns {PromiseLike<T> | Promise<T>}
 * @private
 */
async function request(url, method, headers, data) {
 const options = {
  method: method,
  headers: headers 
 };

 const response = await fetch(url, options);
 console.log(await response.json())

 if (response.ok) {
 return await response.json();
 
 }

 return await response.text();
}


This is the answer using POSTMan

{
 "access_token": "1000.fXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX974e79c7e02a8eed2",
 "api_domain": "https:// www . zohoapis . com",
 "token_type": "Bearer",
 "expires_in": 3600
}