New to using API's and not good at JS/Ajax. Sorry if it's a stupid question.
I have the following code, which I got from the developers documentation and updated slightly:
var token = getParameterByName('access_token');
$.ajax({
url: "https://api.myapp.de/api/v2/users/me",
type: "GET",
beforeSend: function(xhr){xhr.setRequestHeader('Authorization', 'bearer ' + token);},
success: function(data) {
console.log(data);
}
});
This works and gets my user information and logs it to the console.
However, I'm trying to build a web app(to learn to code better) that needs to update information by using PATCH. How do I do this using Ajax?
I need to PATCH the following information in the JSON file: "id": "idIwantToUpdate", "ringNumber": 4. I've googled a lot and found some sites that may contain the answer(fe https://www.rfc-editor.org/rfc/rfc7396), but it seems to be described too complex for me to get it. Have been at it for hours with pretty much 0 progress. Anyone able to explain it simple? Thanks!