jquerypostman

How do I write this jQuery code in Postman?


I'm starting to learn about API's and integration. So far I've had no issues with requesting using an URL. However, the other day I came across some API documentation, which had the following jQuery example:

$.ajax({
    url: "https://my.delogue.com/auth/token",
    type: "POST",
    contentType: "application/json; charset=utf-8",
    dataType: 'json',
    cache: false,
    crossDomain: true,
    data: {
        "grant_type": "password",
        "username": "yourusername",
        "password": "yourpassword"
    },
    success: function(data) {
        token = data.access_token;
    },
    error: function(x, y, z) {
        alert(x + '\n' + y + '\n' + z);
    }
});

How do I write this in the Postman software? More specifically, what part is the header, parameter, etc? I'm trying to understand the "anatomy" of the request, and even though this might not be the best place to start, I'd like to give it a shot.


Solution

  • So, I ended up doing the following:

    Apparently that did the trick for me.