に連絡先を挿入しようとしていますMirror API
が、400 Bad Request
エラーが発生し続けます。
リクエストを作成するための私のコードは次のとおりです。
Http h = new Http();
HttpRequest firstPost = new HttpRequest();
firstPost.setEndpoint('https://www.googleapis.com/mirror/v1/contacts');
firstPost.setMethod('POST');
firstPost.setHeader('Authorization', 'Bearer ' +access_token);
System.debug('Bearer '+access_token);
firstPost.setBody(postBody);
firstPost.setHeader('Content-Type', 'application/json');
現在、postBody は次のようにハードコードされています。
{
"kind":"mirror#contact",
"id":"harold",
"displayName":"Harold Penguin",
"imageUrls": ["https://developers.google.com/glass/images/harold.jpg"]
}
access_tokenが送信されていることを確認しました。何か案は?ありがとう!