Skip to content

Get Undo Queue

Request URL

GET /undo

Description

Get a list of undoable operations. Returns a list of all requests currently in the undo queue for a particular user.

Snippet Examples

javascript

const axios = require('axios');
const config = {
  method: 'GET',
  url: '${AMPLIFI_BASE_URL}/undo',
  headers: {
    'token': "A long random string token received from /token request"
  },
};

let result;
try {
  result = await axios.request(config);
  if (result.status === 200) {
    console.log(JSON.stringify(result.data));
  }
} catch (err) {
  console.log({
    errCode: err.code,
    responseStatus: err.response && err.response.status,
    data: err.response && JSON.stringify(err.response.data)
  });
}

cURL

curl --location "AMPLIFI_BASE_URL/undo"  --header "token: A long random string token received from /token request" 

Successful Response Examples

200 UNDO SUCCESSFUL RESPONSE EMPTY UNDO QUEUE

HEADERS

Header Value
token A long random string token received from /token request

REQUEST BODY

none

RESPONSE BODY

{
    "success": true,
    "queue": []
}

200 UNDO SUCCESSFUL RESPONSE GETTING A LIST OF QUEUED ACTIONS

HEADERS

Header Value
token A long random string token received from /token request

REQUEST BODY

none

RESPONSE BODY

{
    "success": true,
    "queue": [
        {
            "name": "funds transfer",
            "userId": "qweaurl8kgtlv9pc",
            "AFiUserId": "qweaurl8kgtlv9pc",
            "payload": {
                "userId": "qweaurl8kgtlv9pc",
                "AFiUserId": "qweaurl8kgtlv9pc",
                "sourceAFiAccountId": "qwegal8kgtmysmels",
                "destinationAFiAccountId": "qwegalgmnr8njtinq",
                "amount": 0.01,
                "currency": "USD",
                "narrative": "Test"
            },
            "secsUntilActionable": 3,
            "redoOnError": 0,
            "dtsQueued": "2023-12-18T13:44:46.919Z",
            "id": "ajhut",
            "isActionable": false
        }
    ]
}