Hi everyone,
Best regards
Evgen Efimov
http://groupdocs.com
Your Document Collaboration APIs
Follow us on LinkedIn, Twitter, Facebook and Google+
Thanks for the reply Evgen,
Best regards
Evgen Efimov
http://groupdocs.com
Your Document Collaboration APIs
Follow us on LinkedIn, Twitter, Facebook and Google+
Hi there,
https://apps.groupdocs.com//document-annotation2/embed/ed0246b4389d2a795430869151886a50f1966081870d7855bdec49d14345471a?uid=7d42aa1c1846da2c
Ok, I’ve gotten to a point where I can give a collaborator All permissions using the value “63”. I do that in the code when I create the collaborator, and when I try with this URL:
https://apps.groupdocs.com//document-annotation2/embed/ed0246b4389d2a795430869151886a50f1966081870d7855bdec49d14345471a?uid=2daee3dddffddb4a
Best regards
Evgen Efimov
http://groupdocs.com
Your Document Collaboration APIs
Follow us on LinkedIn, Twitter, Facebook and Google+
Hi Evgen,
I just did another test, using the same fileId and uid as the one you provided in the sample url, and when I generated the signature, it was different than the one from the sample url.
https://apps.groupdocs.com/document-annotation2/embed/ed0246b4389d2a795430869151886a50f1966081870d7855bdec49d14345471a?uid=2daee3dddffddb4a&signature=yQzwAI%2FHMJE0fvwfBxa5nPmBYEA
https://apps.groupdocs.com/document-annotation2/embed/ed0246b4389d2a795430869151886a50f1966081870d7855bdec49d14345471a?uid=2daee3dddffddb4a
’, null);Best regards
Evgen Efimov
http://groupdocs.com
Your Document Collaboration APIs
Follow us on LinkedIn, Twitter, Facebook and Google+
We switched over to Google Cloud storage yesterday to test that out and I guess that wiped out our GroupDocs documents. I just uploaded a new one.
https://apps.groupdocs.com/document-annotation2/embed/12896d348bf8c7c8f3343873f1558bf226897d25a060c7899ac55b0777e4c671?uid=b85fe6e152f26c8d&signature=Z8FhGma6rQsn4dRByCktuplVWog
https://apps.groupdocs.com/document-annotation2/embed/ed0246b4389d2a795430869151886a50f1966081870d7855bdec49d14345471a?uid=2daee3dddffddb4a
’, null);Best regards
Evgen Efimov
http://groupdocs.com
Your Document Collaboration APIs
Follow us on LinkedIn, Twitter, Facebook and Google+
Hi Evgen,
12:19:11.940 (3940262044)|CALLOUT_REQUEST|[57]|System.HttpRequest[Endpoint=https://api.groupdocs.com/v2.0/mgmt/b85fe6e152f26c8d/users?signature=DlHy1YgAh%2FXPqm4tEL3gGu1rdqw, Method=POST]
12:19:12.388 (4388742645)|CALLOUT_RESPONSE|[57]|System.HttpResponse[Status=Error converting value {null} to type ‘System.Int64’. Path ‘id’, line 1, position 2686., StatusCode=400]
12:19:12.388 (4388792061)|SYSTEM_METHOD_EXIT|[57]|System.Http.send(ANY)
12:19:12.388 (4388821046)|SYSTEM_METHOD_ENTRY|[58]|system.Type.getName()
12:19:12.388 (4388843602)|SYSTEM_METHOD_EXIT|[58]|system.Type.getName()
12:19:12.388 (4388872696)|SYSTEM_METHOD_ENTRY|[61]|System.HttpResponse.getBody()
12:19:12.388 (4388917072)|SYSTEM_METHOD_EXIT|[61]|System.HttpResponse.getBody()
12:19:12.388 (4388938365)|SYSTEM_METHOD_ENTRY|[62]|System.debug(ANY)
12:19:12.388 (4388946698)|USER_DEBUG|[62]|DEBUG|JSON response from server: {“composedOn”:1433175553031,“error_message”:“Error converting value {null} to type ‘System.Int64’. Path ‘id’, line 1, position 2686.”,“result”:{},“status”:“Failed”}
12:19:12.388 (4388954007)|SYSTEM_METHOD_EXIT|[62]|System.debug(ANY)
This is the code I’m using to create the user:
public GD_UserInfo createUser() {
GD_GroupDocsSecurityHandler securityHandler = new GD_GroupDocsSecurityHandler(GD_Utils.privateKey);
GD_ApiClient api = new GD_ApiClient(securityHandler);
GD_MgmtApi mgmtApi = new GD_MgmtApi(api);
//Check if user exists:
String userEmail = UserInfo.getUserEmail();
GD_GetAccountUsersResponse userResp = mgmtApi.GetAccountUsers(GD_Utils.clientId);
List<GD_UserInfo> users = userResp.result.users;
for(GD_UserInfo user : users){
if(userEmail.equalsIgnoreCase(user.primary_email)){
//User found, don't recreate
status += 'createUser guid (found): ' + user.guid;
return user;
}
}
GD_UserInfo userObj = new GD_UserInfo();
GD_RoleInfo role = new GD_RoleInfo();
List<GD_RoleInfo> rolesList = new List<GD_RoleInfo>();
//Set user role Id. Can be: 1 - SysAdmin, 2 - Admin, 3 - User, 4 - Guest
role.name = ‘User’;
role.id = 3;
//Set user role name. Can be: SysAdmin, Admin, User, Guest
List USER = [SELECT FirstName, LastName FROM User WHERE Email = :userEmail LIMIT 1];
userObj.firstname = USER[0].FirstName;
userObj.lastname = USER[0].LastName;
userObj.primary_email = userEmail;
rolesList.add(role);
userObj.roles=rolesList;
<b>GD_CreateUserResponse createAccountUserResponse = mgmtApi.CreateUser(GD_Utils.clientId, userObj);</b>
string status = createAccountUserResponse.status;
if (status.containsIgnoreCase('ok')) {
GD_CreateUserResult result = createAccountUserResponse.result;
String newUserGuid = result.user.guid;
status += 'newUserGuid: ' + newUserGuid;
userObj.guid = newUserGuid;
}else {
this.status =createAccountUserResponse.error_message;
}
return userObj;
}</span></font></pre><pre class="codeBlock" style="background-color: rgb(248, 248, 248);">I've also confirmed that the email, firstname and lastname being used in the GD_UserInfo object are not null.</pre><pre class="codeBlock" style="background-color: rgb(248, 248, 248);"><br></pre><pre class="codeBlock" style="background-color: rgb(248, 248, 248);">Any idea?</pre></div>
Best regards
Evgen Efimov
http://groupdocs.com
Your Document Collaboration APIs
Follow us on LinkedIn, Twitter, Facebook and Google+
Hi Evgen,
Best regards
Evgen Efimov
http://groupdocs.com
Your Document Collaboration APIs
Follow us on LinkedIn, Twitter, Facebook and Google+
Thanks Evgen,
12:19:11.940 (3940262044)|CALLOUT_REQUEST|[57]|System.HttpRequest[Endpoint=https://api.groupdocs.com/v2.0/mgmt/b85fe6e152f26c8d/users?signature=DlHy1YgAh%2FXPqm4tEL3gGu1rdqw, Method=POST]
12:19:12.388 (4388742645)|CALLOUT_RESPONSE|[57]|System.HttpResponse[Status=Error converting value {null} to type ‘System.Int64’. Path ‘id’, line 1, position 2686., StatusCode=400]
12:19:12.388 (4388792061)|SYSTEM_METHOD_EXIT|[57]|System.Http.send(ANY)
12:19:12.388 (4388821046)|SYSTEM_METHOD_ENTRY|[58]|system.Type.getName()
12:19:12.388 (4388843602)|SYSTEM_METHOD_EXIT|[58]|system.Type.getName()
12:19:12.388 (4388872696)|SYSTEM_METHOD_ENTRY|[61]|System.HttpResponse.getBody()
12:19:12.388 (4388917072)|SYSTEM_METHOD_EXIT|[61]|System.HttpResponse.getBody()
12:19:12.388 (4388938365)|SYSTEM_METHOD_ENTRY|[62]|System.debug(ANY)
12:19:12.388 (4388946698)|USER_DEBUG|[62]|DEBUG|JSON response from server: {“composedOn”:1433175553031,“error_message”:“Error converting value {null} to type ‘System.Int64’. Path ‘id’, line 1, position 2686.”,“result”:{},“status”:“Failed”}
Best regards
Evgen Efimov
http://groupdocs.com
Your Document Collaboration APIs
Follow us on LinkedIn, Twitter, Facebook and Google+
Another error:
the error is: Cannot convert null value to Groupdocs.Common.Applications. Path ‘apps’, line 1, position 2746.
it seems the apps field for UserInfo object is required, but I cannot find any documentation as to what are valid values for that field.
Hello,
Best regards
Evgen Efimov
http://groupdocs.com
Your Document Collaboration APIs
Follow us on LinkedIn, Twitter, Facebook and Google+