Route /requesttoken not found error in REST API request

Created a new v. 3.8.0 instance in a newly created Tigergraph account.
Created a secret.
With the secret, I am attempting to send a REST API request to obtain a token.
This code is working perfectly for an older instance, v. 3.5.3.
As per the documentation, I just changed the port from 9000 to 443.

function tgGetToken (secret, domain = "localhost", lifetime = 1000000) {
var url = "https://" + domain + ".i.tgcloud.io:443/requesttoken";
var data = {
  "secret": secret,
  "lifetime": lifetime
};
var options = {
    "method": "post",
    'contentType': 'application/json',
    "payload": JSON.stringify(data)
};
var response = UrlFetchApp.fetch(url, options).getContentText();
return response;
}

And the returned error:

Exception: Request failed for https://simplify-mvp.i.tgcloud.io:443 returned code 404. Truncated server response: {"error":true,"message":"Route /requesttoken not found.","results":null} (use muteHttpExceptions option to examine full response)

What am I missing?

Hi Mor,

The new URL for request token since 3.6 is https://simplify-mvp.i.tgcloud.io/restpp/requesttoken

Best,
Renchu

1 Like

Oh well. Token works now.
This has changed for all requests. Doc here: