Question

Retrieving data when invoking an action

  • 18 May 2023
  • 8 replies
  • 115 views

I am using a REST API and want to do the following:

  1. Provide data to a screen and invoke an Action
  2. The action updates some data and I need to retrieve the data
  3. The data is not persisted in a DB, so a subsequent query is not possible.

My REST API call performs the action, but no data is returned, only “Status 204 No Content”.

Any help/guidance would be appreciated.

 

Crestwood Associates

Rob Millman


8 replies

Userlevel 7
Badge +5

Returning data from action execution via REST API is not supported besides the success/failure status and an error message

Thanks for the quick reply.  My requirement REST API invocation is:

  1. Provide data to a screen
  2. Screen performs a calculation based on provided data and db lookup(s).
  3. screen needs to update the DB with a log entry that this request occurred
  4. return some field values as a result, which also serves a success/failure.

What might be the best REST API approach to take and where (which event handler) to perform the Calc, db lookup(s) and logging?

 

Userlevel 7
Badge +5

@rmillman33 well, I’d need more details, e.g. what the business process is, frequency of those updates, etc. Current requirement is very generic

 

I am Validating information from the client against the Acu system and need to 1) return some information and 2) log the fact that an inquiry was made.     As an example, verify the status of a customer.  calling system provides an AcctCD and system returns the account name and status, and log the fact that an inquiry was made and the acctcd used.  If the acctcd is not found, that needs to be logged as well and a “notfound” status returned.  This is a simplified example.  I have a screen working that performs all of these steps and uses an action to perform the actual “Check”, but as you mentioned, REST API can’t return a name and status value after invoking an action.  Looking for general guidance on how to accomplish this.

Userlevel 7
Badge +5

@rmillman33 with this scenario in mind I’d just use standard REST API Get/OData Get and implement logging separately on the sending system or something like that.

Logging on the receiving system is the requirement.  Sounds like the Acumatica system doesn’t support this.

Userlevel 7
Badge +5

@rmillman33 if you go with Odata v4 Get API, you’ll be able to see the access logs on the “Access History” screen, but otherwise Acumatica does not support such scenario

 

Userlevel 7
Badge +5

It sounds like a webhook might be what you want. You can feed any data to the webhook, process it in any way and return whatever data you want as a result of the calculations or logic that you want.

So, in your example, you can accept the JSon payload, log the who/when/what of the request, perform the look up and then send back a JSon payload with the results of the lookup.

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved