Home>

I used GAS to make a parrot return line bot.
A syntax error has occurred.
I want to know where is wrong.

Error message
Syntax error. (Line 38, file "code")
Applicable source code
var CHANNEL_ACCESS_TOKEN = '****';
var line_endpoint = 'https://api.line.me/v2/bot/message/reply';

function doPost (e) {
  var json = JSON.parse (e.postData.contents);
  var message = json.events [0] .message.text;
  var reply_token = json.events [0] .replyToken;
  if (typeof reply_token === 'undefined') {
    retuen;
  }

  UrlFetchApp.fetch (line_endpoint, {
    'headers': {
      'Content-Type': 'application/json;charset = UTF-8',
      'Authorization': 'Bearer' + CHANNEL_ACCESS_TOKEN,
    },
    'method': 'post',
    'payload': JSON.stringfy ({
      'replyToken': repry_token,
      'messages': [{
        'type': 'text',
        'text': message,
      }],
    }),
  }),


  return ContentService.createTextOutput (JSON.stringify ({'content': 'post ok'})). setMimeType (ContentService.MimeType.JSON);
}

Since line 38 is a return line, I commented it out. This time, an error occurred on line 39. Since that is the last part of doPost, I thought it was}.
It would be helpful if someone could tell me how to solve it.