Registering services by REST API

Feedback


SuperMap iPortal's REST API provides the ability to register services that can be achieved by the POST request for the services resource.

When you access and use all of the resources in the iPortal through REST, you need to carry authentication information, such as the Cookie information in the HTTP header, or can Access protected REST service resources based on Token. Where the cookie information can be obtained when login, and the SuperMap Token can be obtained by Getting token.

Example: Registering a single service via the services resource without the need to provide iPortal username and password, just carry token token = 9jD451OhUlsDSJkJe9Wb34AkFS5k8I6FMy2UriguJkS2X-qXofeME0gSDTgW6003REFso7YhS3E5TNdzUoQWXg ...

Send a POST request on services resource:

http://localhost:8090/iportal/web/services.rjson?token=9jD451OhUlsDSJkJe9Wb34AkFS5k8I6FMy2UriguJkS2X-qXofeME0gSDTgW6003REFso7YhS3E5TNdzUoQWXg..

Register a SuperMap REST service, the rjson request body is as follows:

{

    "type": "SUPERMAP_REST",

    "tags": [

        "China"

    ],

    "authorizeSetting": [

        {

            "entityName": "GUEST",

            "entityType": "USER",

            "permissionType": "READ"

        }

    ],

    "metadata": {

        "mdContact": {

            "rpIndName": "",

            "rpOrgName": "",

            "rpPosName": "",

            "rpCntInfo": {

                "cntAddress": {

                    "delPoint": "",

                    "city": "",

                    "adminArea": "",

                    "postCode": "",

                    "country": "",

                    "eMailAdd": ""

                },

                "voiceNum": "",

                "faxNum": ""

            }

        },

        "dataIdInfo": {

            "dataIdent": {

                "idCitation": {

                    "resTitle": "map"

                },

                "idAbs": ""

            }

        },

        "distInfo": {

            "onLineSrc": {

                "linkage": "http://192.168.112.217:8090/iserver/services/map-china400/rest"

            }

        }

    }

}

among them:

After the above POST request is sent, the server returns the following result:

{

    "newResourceID": "115",

    "newResourceLocation": "http://localhost:8090/iportal/web/services/115",

    "succeed": true

}

"newResourceID" specifies the ID of the registered service, "newResourceLocation" indicates the service address. After registration, the services still need to be audited by administrators. Only the audited services can be added to iPortal. For service auditing status, see: servicesCheckStatus resource.