Import user via REST API.

book

Article ID: 211117

calendar_today

Updated On:

Products

CA Automic Workload Automation - Automation Engine

Issue/Introduction

Here is a POST script to import a user object called RESTPAI/RESTAPI into an existing client:

POST {{URLROOT}}://{{HOSTNAME}}:{{PORT}}/{{APIURL}}/{{APIVERSION}}/{{CLIENT}}/objects

Here is the content of the json script:

{
        "path": "ADMIN/USER.OBJECTS",
    "data": {
        "user": {
            "metadata": {
                "version": "12.3.5"
            },
            "general_attributes": {
                "minimum_ae_version": "11.2",
                "child_flags": "00000000000000000000000000000000",
                "last_runtimes": "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
                "name": "RESTAPI/RESTAPI",
                "type": "USER",
                "versioning_id": " "
            },
            "user_attributes": {
                "is_active": "1",
                "eh_refresh_interval": "90",
                "last_session": "2021-03-22 18:10:30.0",
                "privilege": "17591917475327",
                "valid_from": "2000-01-01 00:00:00.0",
                "valid_to": "2000-01-01 00:00:00.0"
            },
            "authorizations": {
                "auth_group": "1",
                "bitcode": "255",
                "filter_object_type": "*",
                "filter_object_name": "*",
                "filter_agent_name1": "*",
                "filter_agent_name2": "*",
                "filter_user_id1": "*",
                "filter_user_id2": "*",
                "filter_file_names1": "*",
                "filter_file_names2": "*",
                "line_number": "1"
            }
        }
    }
}

Cause

How To.

Environment

Release : 12.3

Component : Automation Engine

Resolution

If the object already exists and needs to be overwritten this is the POST command:

POST {{URLROOT}}://{{HOSTNAME}}:{{PORT}}/{{APIURL}}/{{APIVERSION}}/{{CLIENT}}/objects?overwrite_existing_objects=true

See also:

AE REST API documentation

 

POST/{client_id}/objects Can be used to import single objects