OK, not sure what this problem is. I am trying to post an API request to PayPal via cURL and I get the following result. Is there something that I am missing in my call that would cause this?
According to PayPal, the call is correct and it works fine when I use the PHP cURL wrapper functions...Weird.
Thanks for helping!
curl https://api.sandbox.paypal.com/2.0/ -H "X-PAYPAL-SECURITY-USERID: api1.sitetest.com" -H "X-PAYPAL-SECURITY-PASSWORD: 111222222UH24" -H "X-PAYPAL-DEVICE-IPADDRESS: 170.10.125.52" -H "X-PAYPAL-MESSAGE-PROTOCOL: SOAP11" -H "X-PAYPAL-APPLICATION-ID: APP-80W284485P519543T" -E "/Users/Me/Library/PayPal_Keys/cert_key_pem.txt" -d "<SOAP-ENV:Envelope xmlns:xsi=\"http://www.w3.org/1999/XMLSchema-instance\" xmlns:SOAP-ENC=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:SOAP-ENV=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/1999/XMLSchema\" SOAP-ENV:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\"><SOAP-ENV:Header /><SOAP-ENV:Body><CreateAndSendInvoiceRequest><requestEnvelope><errorLanguage>en_US</errorLanguage></requestEnvelope><invoice><merchantEmail>sweet#sweetsounds.com</merchantEmail><payerEmail>me#testsite.com</payerEmail><businessName>Test Business, Inc.</businessName><logoURL></logoURL><itemList><item><name>Test Item</name><quantity>2</quantity><unitPrice>5.79</unitPrice><taxName>sales</taxName><taxRate>6.0</taxRate></item></itemList></invoice></CreateAndSendInvoiceRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>"
Returns
<SOAP-ENV:Fault><faultcode>SOAP-ENV:Client</faultcode><faultstring>Method not implemented</faultstring></SOAP-ENV:Fault>
Solved this. PayPal changed the sandbox api url for this particular call and did not update that in their docs.
new url for sandbox is "https://api-3t.sandbox.paypal.com/2.0/". You can test your commands here
Related
I need to use POST method for a REST API.It's working perfectly in SOAP UI while i select "Preemptive Authentication" , I need to assemble this authentication option in Curl.
At Web service , preemptive properties has not set. It has only Basic authentication system with username & password.
I have tried --anyauth , it's not working. I have below command.
curl -X POST -H "content-type:application/json" --verbose -u username:password http://example.net:1234/api/Flows/UpdateStatus -d '{"EventId": "123","Status": "success"}'
I am always getting below error.
{"Message":"Authorization has been denied for this request."}
I had tried with providing base64 encoded value of user & password at header section instead of providing user & password under user section ,and it got worked for me.
curl -X POST -H "content-type:application/json" --verbose -H "Authorization: Basic Base64_encoded_value_of_user_&_password" http://example.net:1234/api/Flows/UpdateStatus -d '{"EventId": "123","Status": "success"}'
I trying to debug a REST extension in MarkLogic by using xdmp:log() inside the XQuery. Seems I am having some issues invoking a POST call in general actually...? Bit confused now.
I use the exact example code as from the MarkLogic documentation here
I installed it via Roxy > deploy > ext
It is there when I look into http://host:port/v1/config/resources
The PUT command provided in the doc works and returns the "Done".
But I cannot get the POST statement to dump the xdmp:log messages in the errorlog.txt on the server?
I tried several curl commands:
curl --anyauth --user admin:admin -X POST http://host:8040/LATEST/resources/example
curl: (52) Empty reply from server
Question: What is the correct curl command to trigger the examples POST functon so something shows up in the log?
This is a curl issue. You need to specify a request body for curl to send.
curl --anyauth --user admin:admin -X POST -d '{"key":"value"}' http://host:8040/LATEST/resources/example
Or if you want to send an empty body just do this:
curl --anyauth --user admin:admin -X POST -d '' http://host:8040/LATEST/resources/example
I have tried few openid connect end points, but none of them seems working. For example, I tried For getting an authorization code:
https://www.sandbox.paypal.com/webapps/auth/protocol/openidconnect/v1/authorize
For the token:
https://www.sandbox.paypal.com/webapps/auth/protocol/openidconnect/v1/tokenservice
I have also tried these, without success:
https://api.sandbox.paypal.com/v1/identity/openidconnect/tokenservice
https://api.sandbox.paypal.com/v1/identity/openidconnect/authorize
please refer to
https://developer.paypal.com/docs/rest/api/identity/?mark=openid
For example:
curl -v --insecure https://api.sandbox.paypal.com/v1/identity/openidconnect/tokenservice -H "Accept: application/json" -H "Accept-Language: en_US" -d "client_id=<Client-Id>" -d "client_secret=<Secret>" -d "grant_type=authorization_code" -d "code=<Authorization-Code>"
Looking at the documentation, the authorize URI for the sandbox is:
https://www.sandbox.paypal.com/signin/authorize
I am developing an application that uses the JIRA 6.1 REST API. Can I know a sample JSON Object that I should use, to add a user to a given group in JIRA?
This is the relevant API call: https://docs.atlassian.com/jira/REST/latest/#d2e1694
curl -D- -u admin:password -X POST --data "{\"name\": \"charlie\",\"password\": \"abracadabra\",\"emailAddress\": \"charlie#atlassian.com\",\"displayName\": \"Charlie of Atlassian\"}" -H "Content-Type: application/json" http://jira.server.com/rest/api/2/user/
For more info see. Expand part under application/json, there you can find data example.
How to send queries, refer to Atlassian's documentation.
Came across this thread while looking to do the exact same thing. The answer from #ThePavolC was very good, but it is creating a new user, not adding a user to a group. I combined his answer with info from https://answers.atlassian.com/questions/255778 and came up with this one-liner:
curl --insecure -D- -u admin:password -X POST --data "{\"name\": \"username\"}" -H "Content-Type: application/json" https://myjiraserver.com/rest/api/2/group/user?groupname=mygroupname
Replace password" with the actual admin password.
Replace username" with the name of the user you're adding to the
group.
Replace myjiraserver.com with your JIRA server's FQDN.
Replace mygroupname with the name of the group to which you are
adding this user.
I added the --insecure option because of the private SSL certs used on my server. You may not need that, or you may not be using HTTPS at all (in which case edit the URL to use HTTP).
I want to test an API using curl for Mac.
According to the REST API documentation/forums, the URL should look like this:
http://localhost:8080/sdpapi/request/?OPERATION_NAME=ADD_REQUEST&<your API key>&<Operation> <Details><requester>Me</requester><subject>Test</subject><description>Testing Curl Input</description></Details></Operation>
Here is what I have come up with for the curl command line input:
curl -X POST -d "OPERATION_NAME=ADD_REQUEST&TECHNICIAN_KEY=0...87&INPUT_DATA=<Operation><Details><requester>Me</requester><subject>Test</subject><description>Testing curl input</description></Details></Operation>" http://myserver.mydomain.org/sdpapi/request/
I haven't tried it yet because I am BRAND NEW to this and I'm sure there are problems. Does this look OK and should I give it a whirl?
Figured it out: curl -d "OPERATION_NAME=ADD_REQUEST&TECHNICIAN_KEY=xxxxxxxxxx&INPUT_DATA=TestData.xml" http://xxx.xxx.xx.xx/sdpapi/request/