Calling the Resources API on a memoQ cloud server from Google Scripts
Reference Number: AA-00811 Created: 02-09-2016 08:15 Last Updated: 02-09-2016 08:15 0 Rating/ Voters

In Google Scripts, use the following code to authenticate on the Resources API of a memoQ cloud server:

function restAPILogin() {
    var restURL = "https://longhorn.memoq.com:9091/(servername)/memoqserverhttpapi/v1"; [^]
    var headers = {
        "contentType" : "application/json",
        "Accept" : "application/json"
        };
    var payload = {
        "username": "username",
        "password": "password",
        "LoginMode": "0"
        };
    var options =
    {
        "method" : "post",
        "headers" : headers,
        "payload" : payload
    };
    // Call the rest API
    var result = UrlFetchApp.fetch(restURL + "/auth/login", options);
    Logger.log(JSON.stringify(result));
    return result.AccessToken;
}


Make sure you use "contentType" as in the example above, and specify "LoginMode" as a string.

Rss Comments (Please do not post support requests here.)
  • There are no comments for this article.
Info Add Comment
Nickname: Your Email: Subject: Comment:
Enter the code below:
Quick Jump Menu
Info Missing an article? Let us know!