We are trying to automate the creation of external users on Enterprise Manager (version 10) using API and we have a little problem doing so.
We looked at the docuementation here : https://helpcenter.veeam.com/docs/backu ... ml?ver=100
Problem is that we are doing everything in JSON, not XML.
We tried to build the "EnterpriseAccountCreateSpec" based on what is in the doc but it fails...
Example:
Code: Select all
{
 "EnterpriseAccountCreateSpec": [
  {
   "AccountType": "ExternalUser",
   "AccountName": "bidochon@wtf.fr",
   "Roles": {
    "EnterpriseRole": [
     {
      "EnterpriseRoleUid": "urn:veeam:EnterpriseRole:f84a8b62-49b8-4d0c-b25b-92321b52bab6"
     }
    ]
   },
   "HierarchyScopeObjects": [
    {
     "HierarchyScopeItem": {
      "HierarchyObjRef": "urn:VMware:Tag:23ce9e0f-07b3-4c75-bb80-6fb9ad7a6b59.urn:vmomi:InventoryServiceTag:c64fd257-8244-42d1-a158-38a3a7439fe9:GLOBAL"
     }
    },
    {
     "HierarchyScopeItem": {
      "HierarchyObjRef": "urn:VMware:Tag:e5dac1d0-9491-4200-acc3-6c320ce2d971.urn:vmomi:InventoryServiceTag:c64fd257-8244-42d1-a158-38a3a7439fe9:GLOBAL"
     }
    }
   ],
   "FlrSettings": {
    "FlrInplaceOnly": false
   },
   "SqlSettings": {
    "DenyInPlaceRestore": false
   }
  }
 ]
}
Are we missing something or something else?[10.08.2020 17:27:54] <55> Info [POST] request to [https://XX.XX.XX.XX:9398/api/security/accounts] deserialized. Message: [{"EnterpriseAccountCreateSpec": [{"AccountType": "ExternalUser", "AccountName": "bidochon@wtf.fr", "Roles": {"EnterpriseRole": [{"EnterpriseRoleUid": "urn:veeam:EnterpriseRole:f84a8b62-49b8-4d0c-b25b-92321b52bab6"}]}, "HierarchyScopeObjects": [{"HierarchyScopeItem": {"HierarchyObjRef": "urn:VMware:Tag:23ce9e0f-07b3-4c75-bb80-6fb9ad7a6b59.urn:vmomi:InventoryServiceTag:c64fd257-8244-42d1-a158-38a3a7439fe9:GLOBAL"}}, {"HierarchyScopeItem": {"HierarchyObjRef": "urn:VMware:Tag:e5dac1d0-9491-4200-acc3-6c320ce2d971.urn:vmomi:InventoryServiceTag:c64fd257-8244-42d1-a158-38a3a7439fe9:GLOBAL"}}], "FlrSettings": {"FlrInplaceOnly": false}, "SqlSettings": {"DenyInPlaceRestore": false}}]}]; Parameters: [].
[10.08.2020 17:27:54] <65> Error Failed add account.. RequestUri: [URI template match was not found].
[10.08.2020 17:27:54] <65> Error The specified account type is invalid: (Veeam.Backup.Interaction.RestAPI.CRestAPICommunicationException)
[10.08.2020 17:27:54] <65> Error at Veeam.Backup.Enterprise.RestAPIService.CRestApiSecurityScope.AddAccount(EnterpriseAccountCreateSpecType spec)
[10.08.2020 17:27:54] <65> Error at Veeam.Backup.Enterprise.RestAPIService.CRestSecurityControllerStub.<AddAccount>d__7.MoveNext()
Thank you.
(Having an official documentation in json could help ^^)
