1

I am using a web service with rest, but it requires two headers Finicity-App-Key and Content-Type. In the site's example for Partner Authentication, they use curl and it sends it with the two headers. But when I try to set it in jquery, if I check the network tab in dev tools, I don't see those two headers on the ajax I made. They seem to show under access-control-request-headers like content-type,finicity-app-key.

Does anyone know what's wrong?

Thanks

https://developer.finicity.com/admin/docs

            $.ajax({
                type: "POST",
                url: "https://api.finicity.com/aggregation/v2/partners/authentication",
                dataType: "xml",
                contentType: "application/xml",
                data : '<credentials><partnerId>24455d81430647</partnerId><partnerSecret>v09TAUzbYgsfKnbTFOGn0</partnerSecret></credentials>',
                beforeSend: function (xhr) {
                    xhr.setRequestHeader('Finicity-App-Key', 'a0874b0eda76ae7918c779f8eeef92c1a');
                    xhr.setRequestHeader('Content-Type', 'application/xml');
                },
                success: function(response){
                    alert(response);
                },
                error: function(xhr,status,error){
                    alert("Error:" + JSON.stringify(xhr));
                }
            });

1 Answer 1

1

Try this

$.ajax({
    url: 'your url',
    headers: { 'Finicity-App-Key': 'a0874b0eda76ae7918c779f8eeef92c1a' }
});
Sign up to request clarification or add additional context in comments.

2 Comments

I got it working, it just needs to be run from server with node.js.
@omega did you have to do it with node because of CORS? what was the error you were getting back?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.