Portal 10.7.1 throws error with AddToDefinition endpoint in REST API

267
1
Jump to solution
12-02-2019 06:41 AM
Highlighted
New Contributor III

Greetings,

 

I have a Portal for ArcGIS that I am trying to add a feature service to using the REST API.  So far I've had success creating the service itself.  When I try to add layers to it, I get a peculiar error message:

 

{ "error": { "code": 403, "subcode": 2, "message": "Access to admin resources are not allowed, Signed Request needed for 'AddToDefinition' with table", "details": [] } }

 

This message appears when I try to use the server admin interface to add the layer definition as well.  Attached is the layer definition JSON.  I should say that I have used the same definition to create layers on a hosted feature service in ArcGIS Online with success.  Does anyone have suggestions on how I can add feature layers to a service using the REST API on Portal?  Thanks in advance.

1 Solution

Accepted Solutions
Highlighted
Occasional Contributor

Hi

Your attached layer info is from the admin layer resource. This has some extra private info that is not needed to crease new layers. In general it is best to use the public layer JSON with the admin API. I attached an updated version of your attachment that worked for me.

Note I removed the NaN references- e.g...

                "mmax": NaN,
                "mmin": NaN,

                "zmax": NaN,
                "zmin": NaN

and the adminLayerInfo references - e.g....

"adminLayerInfo": {
    "geometryField": {
        "name": "Shape",
        "srid": 102100
    },
    "tableName": null
},

thanks

Gary

View solution in original post

Reply
0 Kudos
1 Reply
Highlighted
Occasional Contributor

Hi

Your attached layer info is from the admin layer resource. This has some extra private info that is not needed to crease new layers. In general it is best to use the public layer JSON with the admin API. I attached an updated version of your attachment that worked for me.

Note I removed the NaN references- e.g...

                "mmax": NaN,
                "mmin": NaN,

                "zmax": NaN,
                "zmin": NaN

and the adminLayerInfo references - e.g....

"adminLayerInfo": {
    "geometryField": {
        "name": "Shape",
        "srid": 102100
    },
    "tableName": null
},

thanks

Gary

View solution in original post

Reply
0 Kudos