Help

Re: Need help formulating post request with Airtable Script(MD5 encryption also needed)

520 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Kudos_API
4 - Data Explorer
4 - Data Explorer

Hi,

I already have a working api tested by apifox

Kudos_API_0-1718389109271.png

and it produced this code for me 

 

var myHeaders = new Headers();
myHeaders.append("User-Agent", "Apifox/1.0.0 (https://apifox.com)");
myHeaders.append("Content-Type", "application/json");

var raw = JSON.stringify({
"name": "k1d",
"email": "1213@gmail.com"
});

var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow'
};

fetch("/global/i18n-user/register?sign={{sign}}&timestamp={{timestamp}}&appkey={{appkey}}&appuid={{appuid}}", requestOptions)
.then(response => response.text())
.then(result => console.log(result))
.catch(error => console.log('error', error));
 
now I don't know how to proceed
**PS the sign={{sign}} part is a combination of timestamp={{timestamp}}&appkey={{appkey} encrypted with MD5 encryption, but I don't know how to make this encryption in Airtable Script, I'm fairly new to making an api myself as I generally just use make to handle this part but now I need to create it on my own, just to see if the community can help 🙂
1 Reply 1
j-hugg-ins
6 - Interface Innovator
6 - Interface Innovator

Without checking the docs for API Fox ( sorry I can only read English 🙂 it's hard to know exactly what the requirements are for the {{ sign }} value. I'm guessing its some form of authentication step.

What I can tell you is that you won't be able to perform an MD5 encryption in an Airtable Script. As far as I'm aware Airtable Scripts do not support the importing of any libaries or modules, even those native to Node, which you'd need to perform an encryption. My advice would be to check API Fox docs and see if there is a suggested method for getting the {{ sign }} value some other way. Often API's will have an endpoint for authentication where you make a request with your app key and/or id, and get back an access token you can use in your request. Sorry I couldn't be more help!