|
POST
|
Sorry to keep dragging this out, but I'm pretty sure what you're telling me is what I'm doing. Ok, let's try another way. Can you access these nine Hub Site Applications listed on https://hub.arcgis.com via the Python API?
... View more
10-14-2022
02:34 PM
|
0
|
1
|
777
|
|
POST
|
Yes, unless I'm completely missing something I can not access the content on our https://hub.arcgis.com page using any module or submodule.
... View more
10-14-2022
01:44 PM
|
0
|
1
|
2437
|
|
POST
|
Hi @ManushiMajumdar , I have no problems accessing sites on our organization's Hub Community using either module here: from arcgis.gis import GIS
gis = GIS("https://willcounty.maps.arcgis.com", "adminUsername", "password")
sites = str(gis.content.search(query="", item_type="Site", sort_order="asc")) or from arcgishub import hub
myHub = hub.Hub("https://willcounty.maps.arcgis.com", "adminUsername", "password") # or the url of your ArcGIS Online organization
initiatives = myHub.initiatives.search() They both give me the same sites: [<Initiative title:"Capital Project Tracking" owner:WillCoHub>, <Initiative title:"testDelete" owner:jpilbeam_hub>, <Initiative title:"DeciPH-ER " owner:WillCoHub>] you are running into an error because you are signing into your Hub site. That's what I'm after is our stuff on the Hub site: https://hub.arcgis.com. Is that possible with the Python API? That's my question. We have 900+ items.
... View more
10-14-2022
01:22 PM
|
0
|
3
|
2443
|
|
POST
|
No, it's meant to be a more collaborative environment than AGOL. Hub overview.
... View more
10-13-2022
12:23 PM
|
0
|
1
|
2477
|
|
POST
|
I can use the GIS module on our organization's Community Hub site. rom arcgis.gis import GIS
gis = GIS("https://willcounty.maps.arcgis.com/", "user", "password") But, I can't on ArcGIS Hub. This attempt is from an anaconda environment. I also tried from an Pro environment and got same error. from arcgis.gis import GIS
gis = GIS("https://willcountygis.hub.arcgis.com/", "username", "password")
#Error:
---------------------------------------------------------------------------
JSONDecodeError Traceback (most recent call last)
<ipython-input-5-0190cb412727> in <module>
1 from arcgis.gis import GIS
----> 2 gis = GIS("https://willcountygis.hub.arcgis.com/", "username", "password")
c:\ProgramData\Anaconda3\envs\py37\lib\site-packages\arcgis\gis\__init__.py in __init__(self, url, username, password, key_file, cert_file, verify_cert, set_active, client_id, profile, **kwargs)
481 )
482 else:
--> 483 raise e
484 try:
485 if (
c:\ProgramData\Anaconda3\envs\py37\lib\site-packages\arcgis\gis\__init__.py in __init__(self, url, username, password, key_file, cert_file, verify_cert, set_active, client_id, profile, **kwargs)
442 trust_env=kwargs.get("trust_env", None),
443 timeout=self._timeout,
--> 444 proxy=kwargs.get("proxy", None),
445 )
446 if self._portal.is_kubernetes:
c:\ProgramData\Anaconda3\envs\py37\lib\site-packages\arcgis\gis\_impl\_portalpy.py in __init__(self, url, username, password, key_file, cert_file, expiration, referer, proxy_host, proxy_port, connection, workdir, tokenurl, verify_cert, client_id, custom_auth, token, **kwargs)
203 )
204 # self.get_version(True)
--> 205 self.get_properties(True)
206
207 def add_group_users(self, user_names, group_id, admin_names):
c:\ProgramData\Anaconda3\envs\py37\lib\site-packages\arcgis\gis\_impl\_portalpy.py in get_properties(self, force)
1225 ) # issue seen with key, cert auth
1226 if not resp:
-> 1227 raise e
1228
1229 if resp:
c:\ProgramData\Anaconda3\envs\py37\lib\site-packages\arcgis\gis\_impl\_portalpy.py in get_properties(self, force)
1205 resp = None
1206 try:
-> 1207 resp = self.con.post(path, self._postdata(), ssl=True)
1208 except Exception as e:
1209 if (
c:\ProgramData\Anaconda3\envs\py37\lib\site-packages\arcgis\gis\_impl\_con\_connection.py in post(self, path, params, files, **kwargs)
964 params.pop("token", None)
965 # pass
--> 966 elif token_as_header == False and self.token is not None: # as ?token=
...
354 except StopIteration as err:
--> 355 raise JSONDecodeError("Expecting value", s, err.value) from None
356 return obj, end
JSONDecodeError: Expecting value: line 1 column 1 (char 0) According to the GIS Module help docs it doesn't look like you can access Hub. Is there any other way? GIS : represents the GIS, either ArcGIS Online or an ArcGIS Portal
... View more
10-13-2022
08:25 AM
|
0
|
12
|
3316
|
|
POST
|
Found out you have to utilize the UserManager class (with admin privileges). This will get you a list which includes the count of users in your org: from itertools import count
import arcgis
users = arcgis.gis.UserManager(gis)
totalUsers = users.counts(type='user_type', as_df=False)
totalUsers
#prints
[{'key': 'creatorUT', 'count': 538}]
#index it to pull out the integer
totalUsers = users.counts(type='user_type', as_df=False)[0]['count']
totalUsers
#prints
538 Credit goes to this SE answer. This answer has another useful line of code. It allows you to print out the names in a list. allUsers = users.search(query=None, max_users=totalUsers)
allUsers
... View more
10-06-2022
12:50 PM
|
1
|
0
|
2561
|
|
POST
|
Interesting. I may have made a mistake on my last test with the if else statement. I think I was signed in to my AGOL account. Just now, I made sure I was using Hub credentials and I get this: hub_users = gis.users.search()
number = len(hub_users)
if number >= 100:
print('members exceed 100')
else:
print('members are 100 or less')
#prints
members exceed 100 Where to take it from here?
... View more
10-06-2022
08:16 AM
|
0
|
0
|
2570
|
|
POST
|
I was thinking that may be the case. I'm not sure how to avoid that limit either. I put it in an if else statement, and it still was counting 100 or less. But I'm not sure how much you can trust that. hub_users = gis.users.search()
number = len(hub_users)
if number >= 100:
print('members exceed 100')
else:
print('members are 100 or less')
#prints
members are 100 or less
... View more
10-06-2022
07:44 AM
|
0
|
0
|
2575
|
|
POST
|
I'm attempting to access and manage users in our HUB community account with the python API. I'm using our only sign-in credentials. gis = GIS("https://countyhub.maps.arcgis.com", "username", "password") To get the number of members I use: hub_users = gis.users.search()
number = len(hub_users)
number
#prints
100 I don't know where it gets the 100? Our Members page says we have 538 enabled members with any sort of role. Then I attempt to gather some info with the search queries and I'm blocked by an Exception. # anonymous connection to ArcGIS Online
ago_gis = GIS()
# # search the users whose email address ends with esri.com
esri_public_accounts = ago_gis.users.search(query='email = @esri.com')
len(esri_public_accounts) Exception: You do not have permissions to access this resource or perform this operation. (Error Code: 403) Additionally, I've tried with my AGOL sign-in credentials. It also throws the same Exception with querying.
... View more
10-05-2022
02:07 PM
|
0
|
6
|
2630
|
|
POST
|
FF v. 103.0.2. The latest. Ok, duly noted! I cleared the FF cache and the error is gone. Thanks!
... View more
08-15-2022
08:14 AM
|
1
|
0
|
589
|
|
POST
|
That particular error was from the original map. In the map I provided you I get that same in error, at least in FF. The layer draws in both maps using Chrome, however.
... View more
08-15-2022
07:48 AM
|
0
|
2
|
2339
|
|
POST
|
@RussRoberts My layer "Parks" is not showing up in the new Map Viewer once again. It still displays in Map Viewer Classic, however. I've saved the layer in a test web map. Thanks in advance for taking a look. Id = 60417bce11ec4104ab7f5fa5707e035c Here's the error I get in FF console.
... View more
08-15-2022
07:26 AM
|
0
|
4
|
2344
|
|
POST
|
The layer is there now. I haven't made any changes to it. I left the page open overnight and the layer was there this morning. I mean, it only has 100+ features. It was the only layer with that behavior. I tried a different browser (Edge) other than FF last night, but the problem persisted. If I have anymore problems I'll return here. Sorry, I couldn't be more helpful!
... View more
08-12-2022
08:10 AM
|
0
|
5
|
2347
|
|
POST
|
Have you found a resolution to this? I have a published feature layer that displays in the Map Viewer Classic but not the new one. An older version of the layer was working in the new Map Viewer, but I've since removed it and since published a new layer giving it the same name. I have a suspicion that I should change the name and try again.
... View more
08-10-2022
02:34 PM
|
0
|
7
|
2357
|
|
POST
|
Hi, Which layer did you enable editing? The feature service or its view? Also, for others who read this, remember to (re)share with the public on the Collaborate tab after making changes in the feature service settings.
... View more
06-24-2022
12:40 PM
|
0
|
0
|
6979
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 11-13-2025 08:22 AM | |
| 1 | 11-12-2025 08:37 AM | |
| 1 | 10-22-2025 02:14 PM | |
| 1 | 01-17-2019 08:21 AM | |
| 1 | 07-06-2023 07:08 AM |
| Online Status |
Offline
|
| Date Last Visited |
a week ago
|