Select to view content in your preferred language

Cannot get storymap version from endpoint to save storymap

387
3
Jump to solution
08-07-2024 04:43 PM
atmosfairy
Emerging Contributor

Hi there - cannot save storymap as cannot identify storymap version from endpoint (behind firewall) - need to hard code sm_version in code base.

 

File ~/local/venv/lib/python3.11/site-packages/arcgis/apps/storymap/_utils.py:198, in save(story, title, tags, access, publish)

    195:    story._item.resources.update(file=temp.name, file_name=draft)
    197: # get storymap version from endpoint
--> 198: sm_version = story._gis._con.get("https://storymaps.arcgic.com/version")["version"]

 

@NanaeAubry @JohnYaist1 

0 Kudos
1 Solution

Accepted Solutions
ThePreatorian
Esri Contributor

@atmosfairy Thank you for the clarification. I passed along the issue to the python api team, and this will be fixed in the next python api release.

For now, please continue to hard code the value in your current environment

View solution in original post

0 Kudos
3 Replies
ThePreatorian
Esri Contributor

Hi @atmosfairy , any reason your are accessing the item information directly in this use case?
From the code snippet it seems like you might be trying to change the draft information for the story, and then trying to update it.

If you want to access the draft information for the story it should be available in the story._properties attribute. If you make your changes there you can just use story.save() to save those draft changes. I am not aware of any issues with the built in .save() method. 

0 Kudos
atmosfairy
Emerging Contributor

Sorry - should have included preceding traceback. Occurs when:

new_sm.save()

  But if I modify _utils.py to this:

198 #sm_version = story._gis._con.get("https://storymaps.arcgis.com/version")["version"]
199 sm_version = "9.2"

I can save successfully.

0 Kudos
ThePreatorian
Esri Contributor

@atmosfairy Thank you for the clarification. I passed along the issue to the python api team, and this will be fixed in the next python api release.

For now, please continue to hard code the value in your current environment

0 Kudos