I'm very new to Knack and even more recently introduced to java.
I've managed to muddle my way through the creation of an ajax POST that takes my data and posts it to an object successfully. I see from the Knack documentation that after a POST there would be a response from Knack. What I can't figure out is how to capture what the response is.
I would like to capture the response so that I can go on to use the newly created record's ID in subsequent ajax POSTS to other connected objects.
Here is the very simple ajax call that is working to post my data.
$.ajax({
url: 'https://api.knackhq.com/v1/objects/object_38/records/',
type: 'POST',
headers: {
'X-Knack-Application-ID': '123XYZ',
'X-Knack-REST-API-Key': 'ZYX321'
},
data: data
});
I'm assuming I'm going to further this by adding in a "success" and "error" parameter to the ajax call and somehow gathering the response in the success parameter, but I have no idea where to begin doing that.
Can anyone help?
-Jeff