• Resolved donzathak04

    (@donzathak04)


    Hi,

    It’s an amazing plugin !

    I just have a problem with a sending datas in JSON to a webservice. This webservice only accept POST requests if there is a header “x-xxx-api: xxxx xxxxxxx”

    The webservice works well when i call it like this :

    curl -H “x-xx-api: xxxx xxxxxxxxx” -XPOST “webserviceurl?firstName=Testi&lastName=Testa&[email protected]&id=999”

    When i try, i have a 403 error. Forbidden not authorized.

    When i remove quotes (“”) in the name of my header, i have a 400 error. Bad request.

    I think my problem is i cannot configure the header.

    This is my debugg response :

    *** Service ***
    Array
    (
    [name] => webservice name
    [url] => webservice url
    [forms] => Array
    (
    [0] => cf7_11440
    [1] => cf7_12742
    [2] => cf7_13151
    [3] => cf7_14902
    [4] => cf7_14904
    )

    [success] =>
    [failure] =>
    [timeout] => 10
    [as-xpost] => json
    [xpost-wrapper] =>
    [xpost-header] => x-xx-api: Xxxx xxxxxxxxx
    [mapping] => Array
    (
    [0] => Array
    (
    [lbl] => The submitter first name
    [src] => firstname
    [3rd] => firstName
    )

    [1] => Array
    (
    [lbl] => The submitter last name
    [src] => name
    [3rd] => lastName
    )

    [2] => Array
    (
    [lbl] => The email address
    [src] => email
    [3rd] => mail
    )

    [3] => Array
    (
    [lbl] => idProduct
    [src] => idProduct
    [3rd] => 0000
    )

    )

    [separator] => ,
    )

    *** Post (to Service) ***
    Array
    (
    [timeout] => 10
    [body] => {“firstName”:”Test”,”lastName”:”Test”,”mail”:”[email protected]”}
    [headers] => Array
    (
    [x-xx-api:_Xxxx_xxxxxxxxx] =>
    [Content-Type] => application/json
    )

    )

    *** Response ***
    Array
    (
    [headers] => Array
    (
    [date] => Wed, 10 Feb 2016 10:23:53 GMT
    [server] => journey/0.4.0
    [content-length] => 26
    [connection] => close
    )

    [body] => {“error”:”Not Authorized”}
    [response] => Array
    (
    [code] => 403
    [message] => Forbidden
    )

    [cookies] => Array
    (
    )

    [filename] =>
    [safe_message] => physical request failure
    )

    Thx a lot for your work !

    https://ww.wp.xz.cn/plugins/forms-3rdparty-integration/

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Authorization error with header’ is closed to new replies.