Functionalities

Metadata Request

Your applications can query the metadata of the OData service. To get the metadata of the OData service, you must make a HTTP GET call.

Table 1. RESOURCE
AttributesValues
HTTP MethodGET
Resource URL{{host}}/meridium/api/odata/$metadata
Table 2. HEADERS
NameValue
AuthorizationBearer {{accesstoken}}
Tenant{{tenantid}}

Entity Collection Request

To query the list of entities for a family, you must make a HTTP GET call.

Table 3. RESOURCE
AttributesValues
HTTP MethodGET
Resource URL{{host}}/Meridium/api/odata/{entity_name}
Table 4. HEADERS
NameValue
AuthorizationBearer {{accesstoken}}
Tenant{{tenantid}}

Sample Query

{{host}}/Meridium/api/odata/Work_Order?$count=true

Note: The default page size is 1000.

Entity by Id Request

To query an entity based on id, you must make a HTTP GET call.

Table 5. RESOURCE
AttributesValues
HTTP MethodGET
Resource URL{{host}}/Meridium/api/odata/{entity_name}({entityid})
Table 6. HEADERS
NameValue
AuthorizationBearer {{accesstoken}}
Tenant{{tenantid}}

Sample Query

{{host}}/Meridium/api/odata/Work_Order(2003303)

Entity Property Request

To query a property of an entity based on id, you must make a HTTP GET call.

Table 7. RESOURCE
AttributesValues
HTTP MethodGET
Resource URL{{host}}/Meridium/api/odata/{entity_name}({entityid})/{property_name}
Table 8. HEADERS
NameValue
AuthorizationBearer {{accesstoken}}
Tenant{{tenantid}}

Sample Query

{{host}}/Meridium/api/odata/Work_Order(2003303)/Work_Order_ID

Entity Count Request

To find the number of existing entities for a family, you must make a HTTP GET call.

Table 9. RESOURCE
AttributesValues
HTTP MethodGET
Resource URL{{host}}/Meridium/api/odata/{entity_name}/$count
Table 10. HEADERS
NamesValue
AuthorizationBearer {{accesstoken}}
Tenant{{tenantid}}

Sample Query

{{host}}/Meridium/api/odata/Work_Order/$count

Configure Page Size

About This Task

You can configure the page size of the OData request payload.

Procedure

  1. Access the Web.config file.
  2. In the appSettings section, modify the ODATA_PAGE_SIZE value.
    Note: The default page size is 1000.
    Configuration KeyValueType
    ODATA_PAGE_SIZE 1000Integer
  3. Save the Web.config file.

Power M Query

The following is a sample query to authenticate the APM environment and retrieve the metadata.


let
    actualUrl = "<uaahost>/oauth/token",
    record = [grant_type="password",username="<username>",password="<password>"],
    body = Text.ToBinary(Uri.BuildQueryString(record)),
    uaaBasicKey= "Basic <Base64 encoded credentials>",
    options = [Headers =[#"Content-type"="application/x-www-form-urlencoded", #"Accept"="application/json", #"Authorization" = uaaBasicKey], Content=body],
    Source = Web.Contents(actualUrl, options),
    retVal = Json.Document(Source,65001),
    token = retVal[access_token],
    bearerToken = Text.Combine({"Bearer" , token}," "),
    feed = OData.Feed("<web server host>/Meridium/api/odata", null, [Headers = [#"Tenant"= "<tenantid>" , #"Authorization" = bearerToken] ])
    in
    feed
Note: The angle brackets (< >) in the sample query indicate placeholder text. You must replace the placeholder text with an appropriate value before running the query.
The following table lists the placeholder text for the parameters and describes how to obtain the values to replace the placeholder text:
Placeholder TextAction to be Performed
<uaahost>Replace <uaahost> with the hostname of the UAA instance.
To obtain the hostname, perform the following steps:
  1. In the Applications menu, navigate to Setup.

    The Functional Users page appears.

  2. Locate the hostname in the URL in the Token Request URL field.

    For example, in the following URL, xx.predix-uaa.run.aws-usw02-pr.ice.predix.io is the hostname:

    http://xx.predix-uaa.run.aws-usw02-pr.ice.predix.io/oauth/token

<Base64 encoded credentials>Replace <Base64 encoded credentials> with the credentials encoded to base 64.

To create the credentials, base64 encode the Client ID and Client Secret values in the following format: <Client ID>:<Client Secret>

  • To obtain the Client ID, navigate to the Functional Users page (In the Applications menu, navigate to Setup.).
  • To obtain the Client Secret, consult GE Vernova Professional Services.
<web server host>Consult GE Vernova Professional Services to obtain the web server hostname.
Important: Ensure that the IP addresses of the users are included in the allowlist.
<tenantid>Replace <tenantid> with the UUID of your APM tenant.

To obtain the tenant UUID, navigate to the Functional Users page (In the Applications menu, navigate to Setup.).

Note: You cannot access OData using your Single Sign-On (SSO) credentials. You must have a valid User Account and Authentication (UAA) account to access OData. For more information on how to obtain a UAA account, consult GE Vernova Professional Services.