Home>
I used GAS to make a parrot return line bot.
A syntax error has occurred.
I want to know where is wrong.
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.
-
Answer # 1
Related articles
- google api - i want to resolve google authentication error 403: access_denied
- ruby - i want to know how to solve syntax error, unexpected elsif, expecting end-of-input error
- syntax error occurs in nextjs + typescript
- ruby on rails - /app/models/orderrb:2: syntax error, unexpected':', expecting end belongs_to: address ^ send data to db
- google api - set markers when onpress google map
- i want to fix a syntax error in ruby on rails
- google api - [python] how to upload csv from pandasdataframe to google cloud storage
- about syntax error after php version upgrade
- a 400 error occurs when sending post from php to gas (google spread sheet) with curl
- google analytics api - how to get data from google analytics for firebase
- combined use of google maps api
- matplotlib - i want to resolve the return syntax error
- python 3x - i don't know what is causing the syntax error
- google - an error will occur
- google api - how to ask google if you are logged in with oauth2
- vba - i don't know where the syntax error is in the advanced filter in the excel macro
- visual studio - syntax error:';' is missing before'namespace' c2143
- about the cause of syntax error: invalid syntax in python
- javascript - cannot save due to syntax error
- python - i want to resolve a sqlite syntax error
Related questions
- google apps script - line notify is not notified even though gas is executed successfully
- google apps script - post from gas to the home of line works
- javascript - no image returned when sending line api keywords
- i don't know which line messaging api endpoint to choose
- web page scraping using javascript
- google api - pull hangout url from google calendar event with gas
- google apps script - i can write from linebot to google spreadsheet
- javascript - flex message error [gas]
- javascript - i want to receive postback action of line messaging api with googleappsscript