RFC Generator Mexico

FREE
By jfhe88 | Updated 22 days ago | Tools
Popularity

9.3 / 10

Latency

231ms

Service Level

100%

Health Check

N/A

Back to All Discussions

adding the api to google apps script

Rapid account: Tlamaki
tlamaki
a year ago
hello, i'm having some troubles while adding the api to google's apps script, if i try with "message" i get a succesflu response, this is the code:

function rfch(ape1,ape2,nombre,fecha) {

rfc = encodeURI(rfc);
var response = UrlFetchApp.fetch(“https://jfhe88-rfc-generator-mexico.p.rapidapi.com/rest1/rfc/get?apellido_materno="+ape2+"&apellido_paterno="+ape1+"&fecha="+fecha+"&nombre="+nombre+"&solo_homoclave=0&rapidapi-key=KEY”);

if (String(response.getResponseCode())[0] === ‘4’){
return “”
}

var w = JSON.parse(response.getContentText());

return [ [w.response[“message”]] ]

}

But if i try to get the RFC field then i can’t get it to work, here is the code i’m using for rfc:
function rfch(ape1,ape2,nombre,fecha) {
rfc = encodeURI(rfc);
var response = UrlFetchApp.fetch(“https://jfhe88-rfc-generator-mexico.p.rapidapi.com/rest1/rfc/get?apellido_materno="+ape2+"&apellido_paterno="+ape1+"&fecha="+fecha+"&nombre="+nombre+"&solo_homoclave=0&rapidapi-key=KEY”);

if (String(response.getResponseCode())[0] === ‘4’){
return “”
}

var w = JSON.parse(response.getContentText());

return [ [w.response[“rfc”]] ]

}

Join in the discussion - add comment below:

Login / Signup to post new comments