I am working on paypal integration. and make a request to provide evidence in disputes action api.I couldn’t make an array of request body which is given below:
curl -v -X POST https://api.sandbox.paypal.com/v1/customer/disputes/PP-D-27803/provide-evidence
-H "Content-Type: multipart/related; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW"
-H "Authorization: Bearer Access-Token"
-F 'input={
"evidences": [{
"evidence_type": "PROOF_OF_FULFILLMENT",
"evidence_info": {
"tracking_info": [{
"carrier_name": "FEDEX",
"tracking_number": "122533485"
}]
},
"notes": "Test"
}
]
};type=application/json'
-F '[email protected]'
In this request after -F flag i could not make an array because new structure of this json. would u like to make php array of this request api body?.
This is an array that i try send in request:
[
'input' => [
'evidences' => [
[
'evidence_type' => 'PROOF_OF_FULFILLMENT',
'evidence_info' => [
'tracking_info' => [
[
'carrier_name' => 'FEDEX',
'tracking_number' => '122533485'
]
]
],
'notes' => 'Test'
],
]
]
]
2
Answers
In PHP code , as you are try to use curl
It’s a basic post request like form submit from html as you need to send.
for more info you can visit https://www.php.net/manual/en/book.curl.php or can google to use curl with php
I had the same problem, and after communicating with customer service email, he gave me more reference. But at present, it can only be implemented with curl. I tried using postman python requests php, which is not good. This is my curl code.
Note the @ symbol behind