ArcGIS Portal REST APIを使って、ArcGIS Online Organizational Accountにウェブマップ定義をアップロードしようとしています。リクエストの構築と発行にはpythonを使用しています。これまでのところ、アイテムに関する情報は取得できますが、AddItem <\/A>操作はまだ成功していません。常に「{"error":{"code":403,"messageCode":"GWM_0003","message":"このリソースにアクセスする権限またはこの操作を実行する権限がありません。","details":[]}}」というエラーが返されます。<\/P><\/P>しかし、管理者アカウントを使用してトークンを取得し、Itemなどの他の操作は実行できており、ウェブマップのjson定義を取得できます。<\/P><\/P>URLは以下の通りです:<\/P>https:\/\/\/sharing\/rest\/content\/users\/\/addItem?f=json<\/A> <\/P><\/P>添付したのは、この操作で投稿しようとしているJSONのスクラブ済みバージョンです。これは許可されるべきでしょうか?もしそうなら、addItem操作を正常に使用するためにJSONペイロードがどのような形式であるべきか示したドキュメントはありますか?<\/P><\/BODY><\/HTML>
<\/P>
しかし、管理者アカウントを使用してトークンを取得し、Itemなどの他の操作は実行できており、ウェブマップのjson定義を取得できます。<\/P>
URLは以下の通りです:<\/P>
添付したのは、この操作で投稿しようとしているJSONのスクラブ済みバージョンです。これは許可されるべきでしょうか?もしそうなら、addItem操作を正常に使用するためにJSONペイロードがどのような形式であるべきか示したドキュメントはありますか?<\/P><\/BODY><\/HTML>
Make sure you send a POST request, I just tried with your provided json and it works fine:
Thanks Heiko,
I was able to construct a successful post using fiddler thanks to your post. What tool is it that you've pasted the screenshot from?
Matt
That's Postman
Matt,
I came across your question, because I want to create a webmap from json, too -- Without using the webmap GUI builder. I tried adding an item on AGO, and it thinks I'm adding geojson. If you use this technique, uploading through the AGO REST API, will I be able to access the webmap through the regular AGO map view?
AJ
It did make it work using that technique, but you won't be able to access the web map, because I'd have to share it with you.
As Heiko Heijenga noted, he was able to post successfully using the JSON I provided. So I tried again and after some frustration was also able to post the JSON and found a valid web map in my AGOL account. Note that the non-basemap layer in my JSON does not show any data. The web map is OK, but you might want to try it with your own basemap and layer.
The tool that Heiko linked is an easier way to "fiddle" with post requests than fiddler.
This is great! I used POSTMAN to generate a token, and and then upload a webmap, which I can view in the map view, and has an itemid! Thanks!
another alternative to serve out webmapIDs is to parse your webmapID in Cartoview
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.