![[MQ 9.3.0 Jun 2022]](ng930cd.gif)
POST - managed call
Use the HTTP POST method with the call resource to create a Managed File Transfer managed call.
- This resource is available only from version 3 of the IBM® MQ REST API.
This resource is not available in a stand-alone IBM MQ Web Server installation. For more information about the
installation options for the IBM MQ component that runs
the administrative REST API, see The IBM MQ Console and REST API.
For more information about managed calls, see Managed calls.
Resource URL
https://mqweb.ibm.com:9443/ibmmq/rest/v3/admin/mft/call
You can use HTTP instead of HTTPS if you enable HTTP connections. For more information about enabling HTTP, see Configuring the HTTP and HTTPS ports.
Request headers
- Content-Type
- This header must be sent with a value of
application/jsonoptionally followed by;charset=UTF-8. - ibm-mq-rest-csrf-token
- This header must be set, but the value can be anything, including being blank.
- Authorization
- This header must be sent if you are using basic authentication. For more information, see Using HTTP basic authentication with the REST API.
Request body format
The request body must contain attributes for only one managed call. Submitting multiple managed calls in a single request is not allowed.
The body can contain details of an AntScript, executable or a JCL (for agents running on z/OS®).
- job
- JSON object.
- name
- String
- agent
- JSON object.
- name
- String
- qmgrName
- String
- priority
- Integer
- userProperties
- JSON object
- command
- JSON object
- retryCount
- Integer
- retryWait
- Integer
- successReturnCode
- String
- type
- String
- executable
- JSON object
- name
- String
- arguments
- String
- antScript
- JSON object
- name
- String
- target
- String
- arguments
- JSON object
- jcl
- JSON object
- name
- String
Security requirements
The caller must be authenticated to the mqweb server and must be a member of the
MFTWebAdmin or MQWebUser roles. For more information about
security for the administrative REST API, see IBM MQ Console
and REST API security.
If token based security is used, the LTPA token that is used to authenticate the user must be provided with the request as a cookie. For more information about token-based authentication, see Using token-based authentication with the REST API.
a,A or
b,B:<tns:userSandboxes
xmlns:tns="http://wmqfte.ibm.com/UserSandboxes"
xmlns:xsi="https://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://wmqfte.ibm.com/UserSandboxes UserSandboxes.xsd">
<tns:agent>
<tns:sandbox user="^[a-bA-B]*$" userPattern="regex">
<tns:read>
<tns:include name="/mountpath/**"/>
<tns:include name="**" type="queue"/>
</tns:read>
<tns:write>
<tns:include name="/mountpath/**"/>
<tns:include name="**" type="queue"/>
</tns:write>
</tns:sandbox>
</tns:agent>
</tns:userSandboxes>
If you have MFT authority checking turned on, grant additional authorities as described in Restricting user authorities on MFT agent actions.
For the MFTWebAdmin role, managed call requests are submitted under the context
of the mqweb server user ID. To distinguish between different principals of the
MFTWebAdmin role, and for audit purposes, the managed call request submitted
contains the name of the authenticated user as the managed call originator. This method ensures that
there is a record of who initiated the managed call request.
mftadminusr, of the MFTWebAdmin role,
initiates a managed call, the originator data in the XML that is created to describe the managed
call has mftadminusr in the userID element, as shown in this example:<originator>
<hostName>example.com</hostName>
<userID>mftadminusr</userID>
<mqmdUserId>mqm</mqmdUserId>
</originator>
where:- hostName
- Is the name of host where the mqweb server is running.
- userId
- Is the name of the user that is logged in to the mqweb server.
- mqmdUserId
- Is the name of the user under which the mqweb server is running and connects to the command queue manager.
MQWebUser role, the security
principal of the caller must be granted one of the following authorities:- If the command queue is local, that is, the command queue manager and source agent queue manager are the same, grant put authority to the command queue.
- If the command queue is remote, that is, the command queue manager and source agent queue manager are different, grant put authority to the transmission queue.
- If the user ID of a principal that is a member of the
MQWebUserrole is longer than 12 characters, the request fails. Response status code 403 is returned to the caller. - If the caller is assigned more than one role, the highest privilege role that is applicable to the operation is used.
If security is disabled on the mqweb server, the transfer request submitted contains the name
"UNAUTHENTICATED" as the transfer originator.
Response status codes
- 202
- The managed call request has been accepted by the REST API. It might still get rejected by the MFT agent. You should issue a GET command, using the URL
from the
locationresponse header to ascertain the state of the managed call. - 400
- Invalid data provided.
- 401
- Not authenticated.
- 403
- Access prohibited for one of the following reasons:
- Not authorized. The caller is authenticated to the mqweb server and is associated with a valid principal. However, the principal does not have access to the required IBM MQ or MFT resources.
Access prohibited in the current server environment. The administrative REST API is not available in a stand-alone IBM MQ Web Server installation.
- 500
- Server issue, or error code from IBM MQ or MFT.
- 503
- Queue manager not running.
Response headers
- location
- If the request was successful, this header specifies the URL for the new managed call.
Response body format
The response body is empty if the transfer is created successfully.
If an error occurs, the response body contains an error message; see REST API error handling.
Examples
{
"job": {
"name": "pushsecurities"
},
"agent": {
"name":"SECURITIES.AGENT",
"qmgrName":"SECURITIES.QM"
},
"priority": 0,
"command": {
"retryCount": 0,
"retryWait": 0,
"successReturnCode":"0",
"type":"antScript",
"antScript": {
"name": "publish.xml",
"target": "publishsecurities",
"arguments": "filename=abc.csv updateInterval=5"
}
}
}
{
"job": {
"name": "compressfiles"
},
"agent": {
"name":"SECURITIES.AGENT",
"qmgrName":"SECURITIES.QM"
},
"priority": 0,
"command": {
"retryCount": 0,
"retryWait": 0,
"successReturnCode":"0",
"type":"executable",
"executable": {
"name": "compress.sh",
"arguments": "filename zlib"
}
}
}
{
"job": {
"name": "pushsecurities"
},
"agent": {
"name":"SECURITIES.AGENT"
"qmgrName":"SECURITIES.QM"
},
"priority": 0,
"command": {
"retryCount": 0,
"retryWait": 0,
"successReturnCode":"0",
"type":"jcl",
"jcl": {
"name": "publish",
}
}
}