アロハall、Google AppsスクリプトでLinkedin APIを使用していますか?
私は会社のページに投稿するためにlinkedinとgoogle appsスクリプトとの統合を作成します。
すべてのOAuth2の面で、良いですが、私はトークンを持っていますが、問題は体の要求で、見て:
var payload = {"visibility": {"code": "anyone"},"comment": "Testing a full company share!","content": {"submitted-url": "https://www.google.com","title": "Test Share with Content","description": "content description","submitted‐image-url": "https://www.wired.com/wp-content/uploads/2015/09/google-logo.jpg"}};
var headers = {Authorization': 'Bearer ' + Service.getAccessToken()};
var options = {method:'post',headers:headers,payload:payload,muteHttpExceptions:true};
var response = UrlFetchApp.fetch("https://api.linkedin.com/v1/companies/2414183/shares?format=json", options);
私はTEST MY JSONリクエストのAPIGEEを使用するためのrequesは、良いです。いくつかのフォーラムで
[16-12-12 22:38:13:411 EST] {
"errorCode": 0,
"message": "Couldn't parse share document: error: Unexpected element: CDATA",
"requestId": "XNZ80U0LCX",
"status": 400,
"timestamp": 1481600293335
}
がHEARDER私はPUT SHOUDと言う:これは、サーバーの応答である
'Content-Typeの': 'アプリケーション/ JSON'、 '-LI-フォーマットをX': 'JSON'
しかしWHEN HEADER ON PUTこのコードは、サーバーエラーが:
[16-12-12 22:40:00:344 EST] {
"errorCode": 0,
"message": "Couldn't parse Json body: Unexpected character ('v' (code 118)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')\n at [Source: [email protected]; line: 1, column: 2]",
"requestId": "YQFPJKZTMC",
"status": 400,
"timestamp": 1481600400231
}
THANKS ALL