2017-04-26 14 views
0

scimとjavascriptを使用してWorkPlaceでユーザーを作成する際に問題が発生しました。ここ は私のコードです:WorkPlaceでscimを使用してユーザーを作成する

var url2 = "https://www.facebook.com/company/xxxxxxxxxxx/scim/Users/"; 
    var options2 = { 
    'method' : 'POST', 
    'headers': headers, 
    'Accept': 'application/json', 
    'Content-Type': 'application/json', 
    //body: JSON.stringify(userJson), 
    'muteHttpExceptions' : true, 
    //body: userJson 
    'body': JSON.stringify({"userName":"[email protected]","name":{"familyName":"Jensen","givenName":"Barbara"},"active":true,"schemas":["urn:scim:schemas:core:1.0"]}) 
    }; 
    var response2 = UrlFetchApp.fetch(url2,options2); 

しかし、このコードは、エラーを返す:

[17-04-26 07:55:39:939 PDT] { 
    "Errors": [ 
     { 
     "description": "[field:schemas]Invalid Request: Your request can't be parsed or has incorrect syntax.", 
     "code": 1789003 
     } 
    ] 
} 

ソリューションについての任意のアイデア? おかげ JPA

+1

SCIMのFacebookをこすりしようとしないでください。 APIを使用します。 – WizKid

答えて

0

チェックhttp://www.simplecloud.info/#implementations

POST /v2/Users HTTP/1.1 
Accept: application/json 
Authorization: Bearer h480djs93hd8 
Host: example.com 
Content-Length: ... 
Content-Type: application/json 

{ 
    "schemas":["urn:ietf:params:scim:schemas:core:2.0:User"], 
    "externalId":"bjensen", 
    "userName":"bjensen", 
    "name":{ 
    "familyName":"Jensen", 
    "givenName":"Barbara" 
    } 
} 
関連する問題