Skip to content
This repository has been archived by the owner on Mar 31, 2020. It is now read-only.

ArcREST PublishCSVParameters error #52

Closed
geoffreywestGIS opened this issue May 6, 2015 · 3 comments
Closed

ArcREST PublishCSVParameters error #52

geoffreywestGIS opened this issue May 6, 2015 · 3 comments

Comments

@geoffreywestGIS
Copy link

I am consistently receiving this error when trying to publish a CSV as a hosted service.

{u'error': {u'message': u'Unable to publish item.', u'code': 400, u'details': [u"'publishParameters' must be specified."]}}

The script that I am passing is below;

import arcrest

if name == "main":
username = ""
password = ""
portalId = ""
url = "http://www.arcgis.com/sharing/rest" #should this be my organization or /sharing/rest??
itemId = ""
securityHandler = arcrest.AGOLTokenSecurityHandler(username,
password)
admin = arcrest.manageorg.Administration(url, securityHandler)

portal = admin.portals(portalId)


content = admin.content

layerInfo = {
"name": "CSV File",
"type": "CSV",
"fields": [
{
"name": "X_COR",
"type": "esriFieldTypeDouble",
"sqlType": "sqlTypeInteger",
"nullable": "false",
"editable": "false",
"domain": "null"
},
{
"name": "Y_COR",
"type": "esriFieldTypeDouble",
"nullable": "false",
"editable": "false",
"domain": "null"
}
],
"types": [],
"templates": [],
"capabilities": "Query,"
}

publishParameters = arcrest.manageorg.PublishCSVParameters(name="csvTest", locationType="none", layerInfo=layerInfo)

usercontent = admin.content.usercontent(username=username)
statusinfo = usercontent.publishItem(fileType="csv", itemId=itemId, publishParameters=publishParameters)

print statusinfo

@DShokes
Copy link
Contributor

DShokes commented May 15, 2015

What does arcrest.manageorg.PublishCSVParameters(name="csvTest", locationType="none", layerInfo=layerInfo) return for you?

also, Try url= http:// services.arcgis.com/<organization string>/arcgis/admin/
Or try using the string in the rest url, http:// services.arcgis.com/<organization string>/arcgis/admin/services, as your portalid

@geoffreywestGIS
Copy link
Author

I think that my error is related to issue #53. When accessing my added item, I receive;

Item does not have a file.

Error: 500

Which leads me to think publishParameters = arcrest.manageorg.PublishCSVParameters(name="csvTest", locationType="none", layerInfo=layerInfo) is referencing an empty file.

@achapkowski
Copy link
Collaborator

See: #53

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants