Skip to main content
New Participant
Oct 2, 2025 1:58 PM UTC

Get AssetID by entering an Attribute value of that Asset using API

How can I retrieve the AssetID by entering an Attribute value of that Asset. For example, I would like to get the CurbStop Valve Id by entering the Meter Number for that CurbStop Valve. Thanks

    6 replies

    Known Participant
    Oct 2, 2025 4:07 PM UTC

    @anita mallick? Using the /General/Query/Query API call will be the easiest. I just build the query I need in Respond and then use the Browser Developer tools to help give me the API syntax. Below is an example where I query the serial number from a water meter and return other values

     

    API call

    /services/general/query/query?data: {"BoundaryId":null,"Page":1,"PageSize":1000,"QueryValue":"WRELMETER(SerialNo = "3780898199")","ResponseFields":"OBJECTID":true,"AssetID":true,"InstallDate":true,"METER_TYPE":true,"METER_SIZE":true,"SerialNo":true}}

     

    API Response

    {

      "Value": {

        "HasMore": false,

        "Page": 1,

        "Results": [

          {

            "OBJECTID": 1,

            "AssetID": "73612228",

            "InstallDate": "2001-11-11T07:00:00Z",

            "METER_SIZE": 1,

            "METER_TYPE": "Positive Displacement",

            "SerialNo": "3780898199"

          }

        ],

        "TotalRecordCount": 1

      },

      "Status": 0,

      "Message": null,

      "ErrorMessages": [],

      "WarningMessages": [],

      "SuccessMessages": []

    }

    Translate
    New Participant
    Oct 2, 2025 4:07 PM UTC

    Hi Steven,

     

    Thanks for your response. I tried to run the query as below, but am getting back an error message.

     

    /services/general/query/query?data:{“BoundaryId”:null,”Page”:1,”PageSize”:1000, “QueryValue”: “WMETERS(`Serial_Number’=”44367236”)”,”ResponseFields”: “OBJECTID”:true,”Meter_Number”:true,”Serial_Number”:true}}

     

     

    "image.png""image" 

     

    {

    "Value": null,

    "Status": 1,

    "Message": "",

    "ErrorMessages": [

    {

    "FieldName": "QueryValue",

    "MessageType": 2,

    "Code": 2,

    "Service": "QueryService",

    "Name": "FieldIsRequired",

    "DebugDetails": "",

    "DisplayText": "",

    "InnerMessage": null

    }

    ],

    "WarningMessages": [],

    "SuccessMessages": []

    }

     

    Thanks,

    Anita

    Translate
    Known Participant
    Oct 2, 2025 4:07 PM UTC

    Hi Steven,

     

    Thanks for your response. I tried to run the query as below, but am getting back an error message.

     

    /services/general/query/query?data:{“BoundaryId”:null,”Page”:1,”PageSize”:1000, “QueryValue”: “WMETERS(`Serial_Number’=”44367236”)”,”ResponseFields”: “OBJECTID”:true,”Meter_Number”:true,”Serial_Number”:true}}

     

     

    "image.png""image" 

     

    {

    "Value": null,

    "Status": 1,

    "Message": "",

    "ErrorMessages": [

    {

    "FieldName": "QueryValue",

    "MessageType": 2,

    "Code": 2,

    "Service": "QueryService",

    "Name": "FieldIsRequired",

    "DebugDetails": "",

    "DisplayText": "",

    "InnerMessage": null

    }

    ],

    "WarningMessages": [],

    "SuccessMessages": []

    }

     

    Thanks,

    Anita

    @anita mallick?

     

    "Status": 1 is an error, which could be from incorrect syntax of the API URL call.

     

    Status codes

    • -1 - Connection Error
    • 0 - Ok
    • 1 - Error
    • 2 - Unauthorized
    • 3 - InvalidCredentials

     

    Looking at your example, it doesn't appear all of your syntax is correct. It appears like you are using the wrong type of quotes, there are some extra spaces and use of single quotes when not needed.

     

    Did you copy and paste the API call from the browser developer tools when running the Query in Respond and put that info into POSTMAN or whatever tool are trying to test the API call with?

     

    If you can't figure it out, please submit a support ticket to Esri Canada.

     

    Steven

    Translate
    New Participant
    Oct 2, 2025 4:07 PM UTC

    @anita mallick?

     

    "Status": 1 is an error, which could be from incorrect syntax of the API URL call.

     

    Status codes

    • -1 - Connection Error
    • 0 - Ok
    • 1 - Error
    • 2 - Unauthorized
    • 3 - InvalidCredentials

     

    Looking at your example, it doesn't appear all of your syntax is correct. It appears like you are using the wrong type of quotes, there are some extra spaces and use of single quotes when not needed.

     

    Did you copy and paste the API call from the browser developer tools when running the Query in Respond and put that info into POSTMAN or whatever tool are trying to test the API call with?

     

    If you can't figure it out, please submit a support ticket to Esri Canada.

     

    Steven

    Hi Steven,

     

    Thanks, its working now. I added it to the Webhook in Action Manager and clicked on Test. It did not fail and returned results which I checked in the Message Queue.

     

    I have one more question. How would I take the values from the Response and add it to a Custom Field. For eg., I would like to add the Meter Number attribute from the Response to the Custom Field.

     

    Thanks

    Anita

    Translate
    Known Participant
    Oct 2, 2025 4:07 PM UTC

    @anita mallick?

     

    "Status": 1 is an error, which could be from incorrect syntax of the API URL call.

     

    Status codes

    • -1 - Connection Error
    • 0 - Ok
    • 1 - Error
    • 2 - Unauthorized
    • 3 - InvalidCredentials

     

    Looking at your example, it doesn't appear all of your syntax is correct. It appears like you are using the wrong type of quotes, there are some extra spaces and use of single quotes when not needed.

     

    Did you copy and paste the API call from the browser developer tools when running the Query in Respond and put that info into POSTMAN or whatever tool are trying to test the API call with?

     

    If you can't figure it out, please submit a support ticket to Esri Canada.

     

    Steven

    @anita mallick?That's great!

     

    I don't think I have enough information yet to answer that question. Please describe your overall use case and share screenshots of any relevant configuration (ex webhooks) you have.

    Translate
    New Participant
    Oct 2, 2025 4:07 PM UTC

    @anita mallick?

     

    "Status": 1 is an error, which could be from incorrect syntax of the API URL call.

     

    Status codes

    • -1 - Connection Error
    • 0 - Ok
    • 1 - Error
    • 2 - Unauthorized
    • 3 - InvalidCredentials

     

    Looking at your example, it doesn't appear all of your syntax is correct. It appears like you are using the wrong type of quotes, there are some extra spaces and use of single quotes when not needed.

     

    Did you copy and paste the API call from the browser developer tools when running the Query in Respond and put that info into POSTMAN or whatever tool are trying to test the API call with?

     

    If you can't figure it out, please submit a support ticket to Esri Canada.

     

    Steven

    Hi Steven,

     

    I am trying to get the Curb Stop Valve from the Meter Number and create a Repair WorkOrder for the CurbStop Valve. This is related to when our Meter technicians go out in the field and find that the CurbStop Valve linked to the Meter is Inoperable. Through integration, the Meter Number can be sent back to Cityworks by populating to a WO Custom field. I would like to retrieve the CurbStopValve associated with the Meter Number and add it to the WorkOrder and create an Inspection from it.

     

    I have already created Webhooks to -

     

    1. Add CurbStop Valve to Add the CurbStop Valve Asset to the Asset Panel using CurbStop Valve Asse ID in the WO Custom field.
    2. Create an Inspection for that Curb Stop Valve.

     

    "image""image" 

    "image" 

    "image""image" 

    "image" 

    "image""image""image"Thanks

    Anita

    Translate