AUGForums.com

An Acumatica User Group

  • Forums
  • Podcast
  • Blog
  • Rolodex
  • Login
  • Start Here
  • Consulting
  • Courses
  • Register

Acumatica Web Services Basics in 2019 R2

December 10, 2019 by Tim Rodman

Here are my notes from a webinar on the Web Services REST API in Acumatica 2019 R2, including some really cool stuff about OData.

Starting an #Acumatica Webinar on Web Services Basics – Rest API #Acumatica2019R2WebServices pic.twitter.com/0R8kftOMxw

— Tim Rodman (@TimRodman) December 10, 2019

Agenda for 1st part on Rest API #Acumatica2019R2WebServices pic.twitter.com/YPkvZfX7UC

— Tim Rodman (@TimRodman) December 10, 2019

Types of Web Services in Acumatica #Acumatica2019R2WebServices pic.twitter.com/j3JZ9XeKNE

— Tim Rodman (@TimRodman) December 10, 2019

Endpoints are basically screens and fields that you can access #Acumatica2019R2WebServices pic.twitter.com/nODKUnLnOW

— Tim Rodman (@TimRodman) December 10, 2019

The different types of Request Types available. #Acumatica2019R2WebServices pic.twitter.com/fml5M3trIa

— Tim Rodman (@TimRodman) December 10, 2019

Parameters that you can use in a Web Service Request #Acumatica2019R2WebServices pic.twitter.com/prOaGVFYne

— Tim Rodman (@TimRodman) December 10, 2019

You can access custom fields or even fields not visible on the screen by adding them to an endpoint or by using $custom parameter #Acumatica2019R2WebServices pic.twitter.com/6Qv5Raz91k

— Tim Rodman (@TimRodman) December 10, 2019

Now for demo in Postman. First need to login. #Acumatica2019R2WebServices pic.twitter.com/XArTxcfD9b

— Tim Rodman (@TimRodman) December 10, 2019

Status "204 No Content" means successfully logged in. #Acumatica2019R2WebServices pic.twitter.com/KwfnzWL8J3

— Tim Rodman (@TimRodman) December 10, 2019

Retrieving all fields from a Sales Order #Acumatica2019R2WebServices pic.twitter.com/Fp5k3P7QSq

— Tim Rodman (@TimRodman) December 10, 2019

You can also retrieve a Sales Order using a filter #Acumatica2019R2WebServices pic.twitter.com/nlTD2YAiHJ

— Tim Rodman (@TimRodman) December 10, 2019

This URL retrieves the top 5 Sales Orders #Acumatica2019R2WebServices pic.twitter.com/9XKAVH1Yg3

— Tim Rodman (@TimRodman) December 10, 2019

Combine $top with $skip to return the "next 5" Sales Orders #Acumatica2019R2WebServices pic.twitter.com/1HnEfuaDl2

— Tim Rodman (@TimRodman) December 10, 2019

Use $select to only retrieve a few fields (OrderType, OrderNbr, and Description in this case) and reduce the amount of data that gets transferred. Especially useful when retrieving a large number of Sales Orders at one time. #Acumatica2019R2WebServices pic.twitter.com/Ev8LzcFTaa

— Tim Rodman (@TimRodman) December 10, 2019

Using $custom to retrieve fields that are not included by default (Document.LastModifiedDateTime in this case) #Acumatica2019R2WebServices pic.twitter.com/gd2r01lJHn

— Tim Rodman (@TimRodman) December 10, 2019

Use $expand to get the Sales Order Line information #Acumatica2019R2WebServices pic.twitter.com/oPLKkOyJrP

— Tim Rodman (@TimRodman) December 10, 2019

Use "Web Service Endpoints" screen in Acumatica to see what screens and fields are available #Acumatica2019R2WebServices pic.twitter.com/Dn2qmj1MLi

— Tim Rodman (@TimRodman) December 10, 2019

There are "sub endpoints" available underneath the screens (like "Details" to retrieve Sales Order Lines) #Acumatica2019R2WebServices pic.twitter.com/mk1TMiVcBc

— Tim Rodman (@TimRodman) December 10, 2019

You can extend an endpoint to create your own endpoint #Acumatica2019R2WebServices pic.twitter.com/hblCIJIqB2

— Tim Rodman (@TimRodman) December 10, 2019

Once extended, all endpoints are copied to your new custom endpoint area. A down arrow on the left-hand side means that particular endpoint has not been modified yet. #Acumatica2019R2WebServices pic.twitter.com/DzKUMBPHrT

— Tim Rodman (@TimRodman) December 10, 2019

Now creating a Sales Order. Must include at least the minimum required fields. The entire Sales Order gets returned to you after it has been created. #Acumatica2019R2WebServices pic.twitter.com/h6yHrTVtwI

— Tim Rodman (@TimRodman) December 10, 2019

Now updating a Sales Order Description. Need to make sure you include the key fields. #Acumatica2019R2WebServices pic.twitter.com/Oxqi6b4tDA

— Tim Rodman (@TimRodman) December 10, 2019

You can also update a record using the really long GUID value #Acumatica2019R2WebServices pic.twitter.com/Do5LXXk0l7

— Tim Rodman (@TimRodman) December 10, 2019

Use a POST command to execute an action, Create Shipment in this case. A response of "202 Accepted" doesn't mean that it succeeded. Whether it succeeded stored in Location Header. #Acumatica2019R2WebServices pic.twitter.com/DCGanf6DNr

— Tim Rodman (@TimRodman) December 10, 2019

Take the Location Header value and do a GET statement on it to see whether it was successful. "204 No Content" means that it was successful. If an error, it would be displayed in the Body below. #Acumatica2019R2WebServices pic.twitter.com/3EcdCaergz

— Tim Rodman (@TimRodman) December 10, 2019

Delete a Sales Order by specifying the Sales Order number in the URL of a DELETE request #Acumatica2019R2WebServices pic.twitter.com/GuJEcLEChT

— Tim Rodman (@TimRodman) December 10, 2019

Rather than authenticating user regular Acumatica username and password, you can authenticate with OAuth. Multiple mechanisms supported. #Acumatica2019R2WebServices pic.twitter.com/DpHAhw3Bxr

— Tim Rodman (@TimRodman) December 10, 2019

To use OAuth in Postman, first use Connected Applications screen. Value displayed after clicking ADD SHARED SECRET button is only displayed once so copy it somewhere safe, only put in Description for testing purposes. Client ID generated automatically. #Acumatica2019R2WebServices pic.twitter.com/Qlsd9FYzRW

— Tim Rodman (@TimRodman) December 10, 2019

Now to use the OAuth info in Postman. Grant Type: Password Credentials. Access Token URL: identity/connect/token. Scope: API. Client ID and Client Secret from Acumatica. Not sure why Username and Password required. #Acumatica2019R2WebServices pic.twitter.com/glKKQy0H5H

— Tim Rodman (@TimRodman) December 10, 2019

If you want to look smart around your friends or you just like doing things the hard way, you can use the "Body" tab rather than the "Authorization" tab and enter the information there. Scope set to both "api" and "offline_access" for some reason. #Acumatica2019R2WebServices pic.twitter.com/DrSTTN8P0G

— Tim Rodman (@TimRodman) December 10, 2019

Starting in Acumatica 2019 R2, you can retrieve multiple sales orders with their lines because optimization now available for sales orders. However, optimization not available on all screens. #Acumatica2019R2WebServices pic.twitter.com/6fBb3P2oPx

— Tim Rodman (@TimRodman) December 10, 2019

This is how you can "attach a file to" or "retrieve a file from" a record. File contents get specified in the body. #Acumatica2019R2WebServices pic.twitter.com/VuC2krGBcN

— Tim Rodman (@TimRodman) December 10, 2019

Attaching a file to a Sales Order using Postman #Acumatica2019R2WebServices pic.twitter.com/eqYeusJ2tB

— Tim Rodman (@TimRodman) December 10, 2019

Now when we retrieve a Sales Order, it lists the attached files on the bottom of the reply. #Acumatica2019R2WebServices pic.twitter.com/nGWkNIXSxc

— Tim Rodman (@TimRodman) December 10, 2019

You can use the File ID and a "files" request to retrieve the contents of the file. #Acumatica2019R2WebServices pic.twitter.com/h3Rr7mcEvO

— Tim Rodman (@TimRodman) December 10, 2019

There are 3 types of API limitations included with your Acumatica license. Fortunately, if you reach the limit, your request is not lost but goes into a queue and will process when there is a free space. License Error Code is 429. #Acumatica2019R2WebServices pic.twitter.com/v1xYyDUfRR

— Tim Rodman (@TimRodman) December 10, 2019

Checkout the "License Monitoring Console (SM604000)" screen in Acumatica to see what you are licensed for in these 3 API areas: #Acumatica2019R2WebServices pic.twitter.com/RxdKPhRDPn

— Tim Rodman (@TimRodman) December 10, 2019

A few small REST API changes in 2019 R2 #Acumatica2019R2WebServices pic.twitter.com/BXxiz7pbDg

— Tim Rodman (@TimRodman) December 10, 2019

You can now use either "company" or "tenant" (but not both) in an API request. #Acumatica2019R2WebServices pic.twitter.com/QoJsEqvl1G

— Tim Rodman (@TimRodman) December 10, 2019

You can now use an "entity" request to get the version of a site and list of endpoints without even being logged in. If not logged in, no custom endpoints displayed. Hmmm, I wonder if @gabrielmichaud from Velixo Reports requested this. #Acumatica2019R2WebServices pic.twitter.com/5dC7l0lct3

— Tim Rodman (@TimRodman) December 10, 2019

More on the optimised return of multiple details that we already talked about. Optimised has to do with there being no BQL delegates. #Acumatica2019R2WebServices pic.twitter.com/C8KnB2los3

— Tim Rodman (@TimRodman) December 10, 2019

The Persistent ID used to be session-specific which means it would change across multiple sessions, but now it doesn't change for top level entities (it uses NoteID). This makes it easier to work with Acumatica data through APIs. #Acumatica2019R2WebServices pic.twitter.com/L4bAyY9tlz

— Tim Rodman (@TimRodman) December 10, 2019

Here are some additional resources that you can use #Acumatica2019R2WebServices pic.twitter.com/GritHEACNV

— Tim Rodman (@TimRodman) December 10, 2019

One last comment on a long running action (like Create Shipment). When you take the Location Header and check on the status, if it's "202 In Process", then you know the action is still running. "204 No Content" means it completed successfully. #Acumatica2019R2WebServices pic.twitter.com/N9dlGKy9tN

— Tim Rodman (@TimRodman) December 10, 2019

Now for Part 2 of this webinar, covering OData #Acumatica2019R2WebServices pic.twitter.com/u82OdRXV5B

— Tim Rodman (@TimRodman) December 10, 2019

This presentation is based on the I300 course, but Evgeny made some changes to show new features. #Acumatica2019R2WebServices pic.twitter.com/pZAy9kBEI4

— Tim Rodman (@TimRodman) December 10, 2019

Here's our agenda #Acumatica2019R2WebServices pic.twitter.com/ypVYomp2E9

— Tim Rodman (@TimRodman) December 10, 2019

Within the context of Acumatica integration possibilities, we are focused on OData which can only be used to export data. #Acumatica2019R2WebServices pic.twitter.com/25YUvPixem

— Tim Rodman (@TimRodman) December 10, 2019

Reasons to use OData: 1. Easy to implement & easy to get ISV certified. 2. Fast & efficient. 3. Easy to maintain. 4. Very stable. 5. Avoids API licensing restrictions (cool!). 6. Open Authentication can be used starting 2019 R2. #Acumatica2019R2WebServices pic.twitter.com/JFt8MH5Ksq

— Tim Rodman (@TimRodman) December 10, 2019

OData can use Basic or OAuth for authentication #Acumatica2019R2WebServices pic.twitter.com/rTWQLSp4NA

— Tim Rodman (@TimRodman) December 10, 2019

No programming needed, just check "Expose via OData" on a Generic Inquiry. #Acumatica2019R2WebServices pic.twitter.com/sm9D2zSvzy

— Tim Rodman (@TimRodman) December 10, 2019

Here's the list of Generic Inquiries available for OData in our Acumatica instance. #Acumatica2019R2WebServices pic.twitter.com/YzUTm81Doz

— Tim Rodman (@TimRodman) December 10, 2019

We can retrieve the same list using Postman. Authentication and URL all done in one request, using Basic authentication in this example: #Acumatica2019R2WebServices pic.twitter.com/ibJQrVuQol

— Tim Rodman (@TimRodman) December 10, 2019

However, note that this authentication method passes username and password in the URL so you are trusting the SSL certificate to ensure that they won't be intercepted. #Acumatica2019R2WebServices pic.twitter.com/bBtn1FXSs0

— Tim Rodman (@TimRodman) December 10, 2019

Here is the list of OData-enabled Generic Inquiries displayed in Postman #Acumatica2019R2WebServices pic.twitter.com/IklexNkbQk

— Tim Rodman (@TimRodman) December 10, 2019

Add $metadata to see all the fields in each Generic Inquiry, including <Key> section which fields make up the key. #Acumatica2019R2WebServices pic.twitter.com/WE3MQU3N5C

— Tim Rodman (@TimRodman) December 10, 2019

You can change to JSON using Headers if you prefer a simpler format #Acumatica2019R2WebServices pic.twitter.com/prq4TPFY5D

— Tim Rodman (@TimRodman) December 10, 2019

OAuth now supported in 2019 R2. Initial setup in Connected Applications screen in Acumatica. Unlike Part 1 which used "Resource Owner", we'll use "Authorization Code" which is better for ISVs. #Acumatica2019R2WebServices pic.twitter.com/q32xdon48h

— Tim Rodman (@TimRodman) December 10, 2019

In Authorization tab in Postman, use Type=OAuth 2.0 and Request Headers #Acumatica2019R2WebServices pic.twitter.com/nxRtpH2WUI

— Tim Rodman (@TimRodman) December 10, 2019

If you get this error "The client application is not known or is not authorized" it's probably because you forgot a redirect URL which can be site/identity. Using this option prompts user to enter credentials into Acumatica itself. #Acumatica2019R2WebServices pic.twitter.com/c3Yy7PTKKB

— Tim Rodman (@TimRodman) December 10, 2019

The Token that you get (Type=Bearer) can be used moving forward on the Authorization tab. #Acumatica2019R2WebServices pic.twitter.com/2ed26TxgNX

— Tim Rodman (@TimRodman) December 10, 2019

Now for a GET request in both XML and JSON #Acumatica2019R2WebServices pic.twitter.com/LxXuaZjHB2

— Tim Rodman (@TimRodman) December 10, 2019

Use $orderby for fields to sort on and ascending vs. descending #Acumatica2019R2WebServices pic.twitter.com/Lnrto3vYXD

— Tim Rodman (@TimRodman) December 10, 2019

Use $filterby to filter the results #Acumatica2019R2WebServices pic.twitter.com/qCuRT1fc2m

— Tim Rodman (@TimRodman) December 10, 2019

$select with comma-delimited list of field names allows you to specify which fields to retrieve. #Acumatica2019R2WebServices pic.twitter.com/rimFlCBAm8

— Tim Rodman (@TimRodman) December 10, 2019

$top and $skip can also be used #Acumatica2019R2WebServices pic.twitter.com/LxkYHVZcAs

— Tim Rodman (@TimRodman) December 10, 2019

For ISV certification, it's recommended to use $top and $skip to only retrieve up to 5,000 records at a time, retrieve them in batches. #Acumatica2019R2WebServices pic.twitter.com/QF6vGYbiOs

— Tim Rodman (@TimRodman) December 11, 2019

When syncing data, it's recommended to use LastModifiedOn to only retrieve stuff that has changed recently since LastModifiedOn is available in pretty much every Data Access Class (DAC). #Acumatica2019R2WebServices pic.twitter.com/ZZQwCVjuOG

— Tim Rodman (@TimRodman) December 11, 2019

Note that in Acumatica 2019 R2, time zones have been removed from all timestamps and all timestamps are now in UTC #Acumatica2019R2WebServices pic.twitter.com/fWLbobMKua

— Tim Rodman (@TimRodman) December 11, 2019

Use LastModifiedOn gt datetime'2019-10-24T00.00.00.000' to get records modified since 10/24/2019 #Acumatica2019R2WebServices pic.twitter.com/MTBDrtKIvy

— Tim Rodman (@TimRodman) December 11, 2019

Note that you can use Customization Projects to package and deploy Generic Inquiries with OData to other Acumatica environments. #Acumatica2019R2WebServices pic.twitter.com/y9jXIJZmq4

— Tim Rodman (@TimRodman) December 11, 2019

A recap of the parameters available for OData #Acumatica2019R2WebServices pic.twitter.com/8D25A8sxD3

— Tim Rodman (@TimRodman) December 11, 2019

Final summary information about OData #Acumatica2019R2WebServices pic.twitter.com/vrKeVnOXN2

— Tim Rodman (@TimRodman) December 11, 2019

According to Evgeny, soon you will be able to use OData without a Generic Inquiry by specifying the DAC within the OData URL. Sounds very cool!! #Acumatica2019R2WebServices pic.twitter.com/hAyz7FBhIg

— Tim Rodman (@TimRodman) December 11, 2019

Filed Under: Acumatica Learning Tagged With: Acumatica, Acumatica Blog, Acumatica Learning, Acumatica Training, Acumatica xRP Summit 2019

By using this website, you agree to our Terms of Use (click here)

Online Members

Recent Blog Posts

  • EP 38: From Welder to Consultant, Nick Savage-Mady on his journey with Acumatica and MYOB Advanced (Podcast) January 21, 2021
  • Acumatica Reporting Tools Consulting January 19, 2021
  • EP 37: Jody Lorincz, IT Manager at MHR Brands, sharing his Acumatica Customer Story (Podcast) January 13, 2021
  • EP 36: What Motivates ERP Veteran Nicole Ronchetti To Participate in Acu-Connect (Podcast) January 8, 2021
  • Acumatica and Scanco WMS – A Cautionary Tale for ISVs January 6, 2021
Acumatica Learning Resources

Recent Forum Posts

  • RE: Popup screen fields not being auto populated

    Are you clicking the SEND button in both scenarios or t...

    By Tim Rodman, 4 hours ago

  • Legal Name?

    I am trying to get the Legal name of a company listed i...

    By Chip Fritsch, 5 hours ago

  • RE: Kensium Shopify versus Acumatica Shopify

    @garenmardirossian I have not but I am interested in hi...

    By Carl Brooks, 22 hours ago

  • RE: Kensium Shopify versus Acumatica Shopify

    Have you also seen Biz-Tech Services Shopify Connector?

    By Gary Mardirossian, 1 day ago

  • RE: ACH postings in Acumatica

    ACH payments are better managed via the batch payments ...

    By Michael.Barker, 1 day ago

  • RE: Adding bill description on check stub

    @jswartz Yes, that does make sense, and yes without tho...

    By Chip Fritsch, 1 day ago

  • RE: Adding bill description on check stub

    @cfritsch Chip thank you for that. I did stumble upon t...

    By Jswartz, 1 day ago

  • RE: Create payment

    Hi @cndr, I think you’ll have better luck with this p...

    By Tim Rodman, 1 day ago

  • RE: Changing how fields are displayed on mobile app

    So I was able to figure this out in case we are not the...

    By jvandonkersgoed, 1 day ago

Recent Tweets

Terms of Use & Disclaimers :: Privacy Policy

Copyright © 2021 · AUG Forums, LLC. All rights reserved. This website is not owned, affiliated with, or endorsed by Acumatica, Inc.