API Issue While Adding Device Access to a User in SoftLayer via addBulkVirtualGuestAccess
<p>I'm attempting assign a test user access to a device using the SoftLayer API. (Any referenced functions below are provided by the "SoftLayer_User_Customer" service)</p>

<p>When calling "addBulkVirtualGuestAccess" &amp; "removeBulkVirtualGuestAccess" I am returned true in both cases.
When using "getAllowedVirtualGuestIds" I am returned an empty array, before and after execution of either the previously referenced functions. The test user does not contain any server access initially, so this is expected, however it is not expected after executing the "addBulkVirtualGuestAccess" call.</p>

<p>According to the documentation, true should only be returned in the case that this user already has access to that device, or for the removal function, when the user cannot use that device. There is a possibility perhaps the JSON body I am providing is not appropriate, if this is the case, please let me know.</p>

<p>Equivalent curl command:</p>

<p>echo '{"parameters":[[X,Y]]}' | curl -X POST -u $USERNAME:$KEY --data @- <a href="https://api.softlayer.com/rest/v3/SoftLayer_User_Customer/Z/addBulkVirtualGuestAccess.json" rel="nofollow">https://api.softlayer.com/rest/v3/SoftLayer_User_Customer/Z/addBulkVirtualGuestAccess.json</a></p>

<p>Where X &amp; Y are device integer ID values and Z is the SoftLayer users ID of which the user is to be added to.</p>

<p>Any assistance would be appreciated.</p>

<p>=========================================================================
<strong>UPDATE</strong></p>

<p>It appears I cannot create a comment to meet my reply length requirements, so I shall edit my answer instead.</p>

<p>Thanks for your reply, mcruz.</p>

<p>Your suggestion seemed to work, it appears that a user requires the permission "VIRTUAL_GUEST_VIEW" to be added a device via the addBulkVirtualGuestAccess function.</p>

<p>However it should be noted that similar methods of the same service User_Customer, have unexpected behaviours:</p>

<ul>
<li><strong>addBulkVirtualGuestAccess</strong></li>
</ul>

<p>Returns true when no device has been added to due users permissions. This is misleading and I would expect a user permission exception to be returned.</p>

<ul>
<li><strong>addVirtualGuestAccess</strong></li>
</ul>

<p>Can be used to add VMs individually to a user without the "VIRTUAL_GUEST_VIEW" permission. getAllowedVirtualGuestIds Will return no ID's when this is done, however getVirtualGuests will return the full image JSON data of the VM's added individually, the IDs can be extrapolated from there. </p>

<p>I've spent quite a bit of time debugging the above, I'm glad its finally resolved.</p>

<ul>
<li><p>To aid future users of this service:</p>

<ol>
<li>Can some of the unexpected behaviour outlined aboved of the
addVirtualGuestAccess method can be explained?</li>
<li>Can the addBulkVirtualGuestAccess method be updated to return an
exception if the user truely hasn't been added a device due to a
user permissions issue?</li>
<li>The SoftLayer API reference page makes no reference to the users
required permissions to apply a certain device, perhaps this should
be updated to display this?</li>
</ol></li>
</ul>

<p>Regards,</p>

<p>Paul Connolly</p>