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
MeridiumToken{{meridiumtoken}}

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
MeridiumToken{{meridiumtoken}}

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
MeridiumToken{{meridiumtoken}}

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
MeridiumToken{{meridiumtoken}}

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
MeridiumToken{{meridiumtoken}}

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 = "{{host}}/Meridium/api/core/security/login",
    body = Text.ToBinary("{""DatasourceId"":""datasource"",""Id"":""user"",""Password"":""pwd""}"),
    options = [Headers =[#"Content-type"="application/json"], Content=body],
    Source = Web.Contents(actualUrl, options),
    retVal = Json.Document(Source,65001),
    token = retVal[sessionId],
    feed = OData.Feed("{{host}}/Meridium/api/odata/", null, [Headers = [ MeridiumToken= token ]])
    in
    feed