Macro Integration Point

The macro integration point accepts the following POST request payload:

http://[hostName]:[portNumber]/[api-context-root]/<context-root>/macros
{
  "parameters": [
    {
      "name": "",
      "value": "comment: multivalued parameters hold a comma separated list of values"
    },
    {
      "name": "",
      "value": ""
    }
  ],
  "macroDefinitionCode": "",
  "requestContext": "{ \"id\": \"26551\" }",
  "requestContextList": [
    "{ \"id\": \"26551\" }",
    "{ \"id\": \"26551\" }"
  ]
}

Context for group client (nonlist) example.

{
  "requestContext": {
    "id": "_comment: mandatory",
    "code": "",
    "displayName": "",
    "groupAccountList": [
      "{ \"id\": \"26551\" }"
    ]
  }

}
The macro request context element must specify the object id. This is the subject id for macro history for non-list-based macros.

OIG Integration

The system starts OIG integration as specified by the property ohi.macro.{0}.endpoint. The system sends the macro request as-is, along with the details of the macro resource (rel-link subject) as the payload for OIG integration. To invoke OIG integration, it uses credentials and authentication methods for credentialKey OIG_INTEGRATION_{macrocode}.

Sample Request of Payload created by the system to start the OIG integration:

{
  "parameters": [
    {
      "name": "",
      "value": "// multivalued parameters hold a comma separated list of values"
    },
    {
      "name": "",
      "value": ""
    }
  ],
  "links": [
    {
      "href": "refers to macro history",
      "rel": "subject",
      "httpMethod": "GET"
    }
  ],
  "requestContext": {
    "id": "",
    "code": "",
    "displayName": "",
    "groupAccountList": [
      "{ \"id\": \"26551\" }"
    ]
  }
}

The response for such a macro contains an operator link with a reference to the underlying exchange.

Sample Response of Success

201: Created

{
  "links": [
    {
      "href": "Exchange URI",
      "rel": "operator",
      "httpMethod": "GET"
    },
    {
      "href": "refers to macro history",
      "rel": "monitor",
      "httpMethod": "GET"
    }
  ]
}

If the integration fails to start, one or more error messages are returned as given by the integration

Response

The integration point may return HTTP status codes as defined in Response Messages. If an error occurs, the appropriate HTTP status code (along with a payload containing the error details) is returned.

The following operation-specific errors can occur:

Table 1. Response Messages
Code Severity Message Text

OHI-IP-MRDF-001

Fatal

Macro definition code is unknown.

OHI-IP-MRDF-002

Fatal

Request context could not be parsed.

OHI-IP-MRDF-003

Fatal

Request context or request context list with a valid id element to identify the context object(s) must be specified.

OHI-IP-MRDF-004

Fatal

Either request context or request context list must be specified and not both.

OHI-IP-MRDF-005

Fatal

Request context list must be specified if the macro definition indicates it is for a list.

Access Restriction

A user authorization configuration requires access to start a macro. The relevant access restriction is macro IP and to the macro itself.

Specifying the access restriction grant of type Macro on the macro definition restricts access to the macro.