print "\nWe can get out information such as the href to the launch object:"
print myReference.HrefContent
print "\nand the specific type of that object:"
print myReference.Type


# Now we will want to ask for more permission for the specific reference object
print "\nWe can get out the specific project objects by using 'content':" 
myReference =  myReference.Content
print myReference
print "\nThe scope string for requesting read access to the reference object is:"
print myReference.getAccessStr(scope='write')

# We can easily request write access to the reference object so our App can start contributing analysis
# by default we ask for write permission and authentication for a device
accessMap       = BSapi.getAccess(myReference,accessType='write')
# We may limit our request to read access only if that's all that is needed
readAccessMaps  = BSapi.getAccess(myReference,accessType='read')

print "\nWe get the following access map for the write request"
print accessMap

## PAUSE HERE
# Have the user visit the verification uri to grant us access
print "\nPlease visit the uri within 15 seconds and grant access"
print accessMap['verification_with_code_uri']
webbrowser.open_new(accessMap['verification_with_code_uri'])
time.sleep(15)
## PAUSE HERE

# Once the user has granted us the access to the object we requested we can
print "\nWe can get out information such as the href to the launch object:"
print myReference.HrefContent
print "\nand the specific type of that object:"
print myReference.Type


# Now we will want to ask for more permission for the specific reference object
print "\nWe can get out the specific project objects by using 'content':" 
myReference =  myReference.Content
print myReference
print "\nThe scope string for requesting write access to the reference object is:"
print myReference.getAccessStr(scope='write')

# We can easily request write access to the reference object so our App can start contributing analysis
# by default we ask for write permission and authentication for a device
accessMap = BSapi.getAccess(myReference)
print "\nWe get the following access map"
print accessMap

## PAUSE HERE
# Have the user visit the verification uri to grant us access
print "\nPlease visit the uri within 15 seconds and grant access"
print accessMap['verification_with_code_uri']
webbrowser.open_new(accessMap['verification_with_code_uri'])
time.sleep(15)
## PAUSE HERE

# Once the user has granted us the access to the object we requested we can
# get the basespace access token and start browsing simply by calling updatePriviliges
# on the baseSpaceApi instance    
code = accessMap['device_code']