API GET Command

Please would somebody help me make my first API call.  I have tried asking support for help, they pointed me here

I want to use web services to read a record, should be simple.  I can see the record(s) here

https://builder.knack.com/hht/asset#data/object_1/records

So far my best try is

https://api.knack.com/v1/objects/object_1/records?X-Knack-Application-Id=<value here> &X-Knack-REST-API-KEY=<value here>

 All I get back is 401 not authorised.

Regards Richard

Thanks, David it worked :)  

{

    "total_pages": 1,
    "current_page": 1,
    "total_records": 2,
    "records": [
        {
            "id": "5ef5c7dbce624100158a65db",
            "field_1": "Asset 2",
            "field_1_raw": "Asset 2",
            "field_2": "A002",
            "field_2_raw": "A002"
        },
        {
            "id": "5ef5c7bace624100158a656d",
            "field_1": "Test Asset1",
            "field_1_raw": "Test Asset1",
            "field_2": "A001",
            "field_2_raw": "A001"
        }
    ]
}

Hey Richard,

The issue with your request is that the X-Knack-Application-Id and X-Knack-REST-API-KEY are headers and need to be sent as such instead of as part of the URL. If you are using jQuery ajax ($.get or $.ajax), you can provide these headers under the header key in your options.

Please do note, however, that you should not use your API key in any client-side code (the Javascript section of your Knack app). Instead, use view-based API calls, as described here.

Feel free to reach out at david@hmnd.io if you need any further assistance with this or anything else.