Discussions

Ask a Question
Back to all

Unable to login using the API

I am trying to access the API using Google Sheets. I keep getting the below error on login -->
"status":2,"data":"Invalid API key - App must be granted a valid key by Humanity", "error":"missing api key : ","token":null" for login

Here is my code

function login() {

var url = "https://www.humanity.com/api/";

var payload =
{
"module":"staff.login",
"method":"GET",
"data":{
"key": "api key",
"username": "username",
"password": "password"
}
}
var options =
{
"method":"POST",
"payload" : payload,
};

var result = UrlFetchApp.fetch(url, options);
Logger.log(result);
}