Select to view content in your preferred language

Recycle Bin

491
2
Jump to solution
07-03-2024 06:02 AM
Labels (2)
cheyennecornett
New Contributor

I'm trying to interact with my orgs recycle bin via API for Python and I'm getting an error saying 

'User' object has no attribute 'recyclebin'

I'm using the verbiage from the documentation.

# Usage Example:

>>> gis = GIS(profile="your_online_profile")

>>> my_user = gis.users.me
>>> r_bin_content = my_user.recyclebin.content
>>> type(r_bin_content)

<class 'generator'>

>>> for r_item in r_bin_content:
        print(f"{r_item.properties['title']":15}{r_item.properties['type']}")

trees_sd        Service Definition
trees_flc       Feature Service

 

Has anyone been able to use the recycle bin via code? 

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
MobiusSnake
MVP Regular Contributor

What version of the API are you using?  You can check using this:

arcgis.__version__

View solution in original post

0 Kudos
2 Replies
MobiusSnake
MVP Regular Contributor

What version of the API are you using?  You can check using this:

arcgis.__version__
0 Kudos
cheyennecornett
New Contributor

That was the issue. I thought I was running the latest version. Fixed that and it works now, thank you  

0 Kudos