How to convert curl command to postman(PayPal disputes API) - postman

I encountered a problem while developing here
This curl command is something I have n’t encountered before and it has n’t been resolved for a long time
Please help me
How to convert to postman format, my import using postman cannot be recognized correctly
code:
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 'file1=#NewDoc.pdf'

我自己解决了
看图片
目前只能使用curl成功 postman python requests php 都没有成功
主要还是后面这个#符号
enter image description here

Related

How to create an index pattern in Opensearch using API?

I want to create an index pattern using Opensearch API. I tried to replicate what could be made graphically in the following image window, using as index pattern name cwl-* and then as time field #timestamp.
My domain has OpenSearch 1.2 installed.
Using curl (directly modifiend the command in kibana doc):
curl -u '****:*****' -X POST "https://******.eu-central-1.es.amazonaws.com/api/index_patterns/index_pattern" -H 'osd-xsrf: true' -H 'Content-Type: application/json' -d'
{
"index_pattern": {
"title": "cwl-*",
"timeFieldName": "#timestamp"
}
}'
but I receive
{"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"Rejecting mapping update to [api] as the final mapping would have more than 1 type: [_doc, index_patterns]"}],"type":"illegal_argument_exception","reason":"Rejecting mapping update to [api] as the final mapping would have more than 1 type: [_doc, index_patterns]"},"status":400}
curl -u '****:*****' -X POST "https://******.eu-central-1.es.amazonaws.com/api/index_patterns/cwl-*" -H 'osd-xsrf: true' -H 'Content-Type: application/json' -d'
{
"index_pattern": {
"title": "cwl-*",
"timeFieldName": "#timestamp"
}
}'
change api/index_patterns/index_pattern to api/index_patterns/cwl-* and try again?
It worked for me in OpenSearch 1.3 when I added an ID in the URI and used saved_objects instead of index_patterns.
So your cURL-request should work when looking like this.
curl -u '****:*****' -X POST "https://<opensearch-dashboards-host>.eu-central-1.es.amazonaws.com/api/saved_objects/index-pattern/<ID>"
-H 'osd-xsrf: true'
-H 'Content-Type: application/json'
-d
'{
"index_pattern": {
"title": "cwl-*",
"timeFieldName": "#timestamp"
}
}'

How do I get the stats of all the pillars on the Zenon Network?

Is there an easy way to get all the statistics on the pillars on the Zenon Network?
You can use curl on the command line and access the method: embedded.pillar.getAll (https://testnet.znn.space/#!api.md)
I passed the output to the command jq so it can be easily read.
curl -X POST http://127.0.0.1:35997 -H 'Content-Type:
application/json' -d '{"jsonrpc": "2.0", "id": 20, "method":
"embedded.pillar.getAll","params": [0, 299]}' | jq
This will give you the output of:

How to preserve line breaks in text content de-identified with Data Loss Prevention?

I am using an API call content.deidentify to de-identify text content. It is working as expected, but newline characters get stripped.
API call
curl -s \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json" \
https://dlp.googleapis.com/v2/projects/$PROJECT_ID/content:deidentify \
-d #text-request.json \
> text-response.json
Input
Eleanor Rigby
Pharmacist
Liverpool Hospital
eleanor.rigby#example.com
Output
{
"item": {
"value": "Eleanor Rigby Pharmacist Liverpool Hospital [email-address]"
},
"overview": {
...
}
}
Is there any option I can add to the request to preserve the line breaks?
I found setPrettyPrint in the Java client documentation. Can I use this option when calling the API directly?
The issue had nothing to do with DLP.
I was sending invalid JSON:
{
"item": {
"value": "Eleanor Rigby
Pharmacist
Liverpool Hospital
eleanor.rigby#example.com"
},
"deidentifyConfig": {
...
}
}
Replacing the newline characters with \n solved the problem.

To run curl command on postman getting error as Error while importing Curl: arg.startsWith is not a function

I have a curl link which is successfully run with terminal but i want to convert it as a POSTMAN request where link is,
curl -v --silent -H "Accept: application/vnd.docker.distribution.manifest.v2+json" -X GET -u <registry-user>:<registry-password> https://sc-docker-registry.eic.fullstream.ai/v2/<image-name>/manifests/<tag> 2>&1 --insecure | grep Docker-Content-Digest | awk '{print ($3)}'
I have set header and auth but unable to set 2>&1 --insecure | grep Docker-Content-Digest | awk '{print ($3)}'
Where do I set 2>&1 --insecure | grep Docker-Content-Digest | awk '{print ($3)}' command in postman
I had the issue when using "Copy all as cURL (bash)" instead of just "Copy as cURL (bash)".
A few concatenated curl commands were copied. And Postman's import didn't like that.
I had the same issue but chrome now gives you the option to copy curl as (bash) or (cmd). I had the issue when using copy as cmd but worked when I used copy as bash
I had the same error and I think it's unrelated to the pipeline arguments you sent at the end of the curl. Enclosing url part into double quotes helped with my case. Looks like its a bug in curl-to-postman library
Personally for me the problem was a semicolon at the end of the cURL request. Try to remove all the noise you can until you find what sort of character is making postman have that error
curl 'http://catalog.data.gov/api/3/' \
-H 'authority: 1fzqk3npw4.execute-api.us-east-1.amazonaws.com' \
-H 'accept: */*' \
-H 'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.111 Safari/537.36' \
--compressed ;
Remove the semicolon at the end
I removed all the single quotes to Double quotes and it worked !!!
Not Working CURL
curl --location --request POST 'http://localhost/data/?type=MOBILE&value=77700023656' \
--header 'accept: */*'
WORKING CURL (changed single quotes --> double quotes)
curl --location --request POST "http://localhost/data/?type=MOBILE&value=77700023656" \
--header "accept: */*"
remove character \ in the end of all lines
for who is using vscode, replace all by regex

Curl Error when trying to POST to AWS endpoint

I got
error: {"error":"Unexpected token ‘"}
with the curl command below.
What gives?
curl -X POST \
-H "X-Parse-Application-Id:SomeID" \
-H "Content-Type: application/json" \
-d ‘{“number”:"3016524500"}’ \
http://somedomain.com/parse/functions/testFunction
Please suggest.
I think the issue is that you're using different characters than the actual ' and " characters. Try replacing ” with " and ‘ with '.