Google Appscript to Login

1 post / 0 new
eddiel93
Google Appscript to Login

Hi,

I have been trying to login to my account using Google App Scripts. I have used the following code but for some reason it returns a 404 error:

function UserAction() {
var url = "https://api.ig.com/gateway/deal";
var options = {
"method": "post",
"headers": {
"Content-Type": "application/json; charset=UTF-8",
"Accept": "application/json; charset=UTF-8",
"X-IG-API-KEY":"70c82086e19999e344fe5962ef5d0af0ae20ec70",
"Version": 2
},
"payload": {
"identifier": identifier,
"paswword": password
}
};
var response = UrlFetchApp.fetch(url, options);
}

Does anyone know how this could be fixed?