DAC-Based OData: To Sign In to MYOB Acumatica and Retrieve the Metadata
This activity will walk you through the process of signing in to MYOB Acumatica and retrieving the metadata when you use the DAC-based OData interface.
Story
Suppose that you are a developer who needs to investigate the options available in MYOB Acumatica for integration with business intelligence (BI) applications. As a part of this task, you need to test the DAC-based OData interface. To send requests to MYOB Acumatica through the DAC-based OData interface, you need to sign in to MYOB Acumatica.
Process Overview
You will configure a Postman collection to use the basic authentication. To test the sign-in, you will retrieve the full list of DACs, their fields, the fields' types, and the navigation properties of DACs, which are relationships between the DACs.
System Preparation
Before you begin performing this activity, do the following:
- Deploy an instance of MYOB Acumatica with the name MyStoreInstance and a tenant that has the MyStore name and contains the T100 data.
- Make sure the Postman application is installed on your computer. To download and install Postman, follow the instructions on https://www.postman.com/downloads/.
Step 1: Signing In to MYOB Acumatica
For sign-in in MYOB Acumatica, you will use basic authorization. To configure basic authorization in Postman, do the following:
- In Postman, create a new collection.Tip: Instead of creating a new collection, you can use the same Postman collection that is used in Generic Inquiry Access Through OData: To Sign In to MYOB Acumatica and Retrieve the Metadata.
- On the Authorization tab, specify its authorization
settings as follows:
- In the Type box, select the Basic Auth type.
- In the Username and Password boxes, type the credentials that you are using to access the MYOB Acumatica instance.
- Click Save.
Step 2: Retrieving the Metadata
To test the sign-in and retrieve the metadata, do the following:
- In the Postman collection, create a
GETrequest to the following URL.http://localhost/MyStoreInstance/t/MyStore/api/odata/dac/$metadata - Send the request. The response of the successful request contains the
200 OKstatus code. The following code example shows a fragment of the response body.<edmx:Edmx xmlns:edmx="http://docs.oasis-open.org/odata/ns/edmx" Version="4.0"> <edmx:DataServices> <Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="PX.Api.Mobile.Workspaces"> <EntityType Name="MobileSiteMapWorkspaces"> <Key> <PropertyRef Name="Name"/> </Key> <Property Name="MobileWorkspaceID" Type="Edm.Guid"/> <Property Name="Owner" Type="Edm.String"/> <Property Name="Name" Type="Edm.String"/> <Property Name="DisplayName" Type="Edm.String"/> <Property Name="SortOrder" Type="Edm.Int32" Nullable="false"/> ... <NavigationProperty Name="UsersByCreatedByID" Type="PX.SM.Users"> <ReferentialConstraint Property="CreatedByID" ReferencedProperty="PKID"/> </NavigationProperty> <NavigationProperty Name="UsersByLastModifiedByID" Type="PX.SM.Users"> <ReferentialConstraint Property="LastModifiedByID" ReferencedProperty="PKID"/> </NavigationProperty> </EntityType> </Schema> ... <Schema xmlns="http://docs.oasis-open.org/odata/ns/edm" Namespace="Default"> <EntityContainer Name="Container"> <EntitySet Name="PX_Api_Mobile_Workspaces_MobileSiteMapWorkspaces" EntityType="PX.Api.Mobile.Workspaces.MobileSiteMapWorkspaces"> <NavigationPropertyBinding Path="UsersByCreatedByID" Target="PX_SM_Users"/> <NavigationPropertyBinding Path="UsersByLastModifiedByID" Target="PX_SM_Users"/> </EntitySet> ... <Singleton Name="ApplicationVersion" Type="PX.SM.Version"/> <Singleton Name="Version" Type="PX.SM.Version"/> <Singleton Name="PX_Web_UI_SMPageCache" Type="PX.Web.UI.SMPageCache"/> </EntityContainer> </Schema> </edmx:DataServices> </edmx:Edmx>
- Save the request.
