While following this guide(https://parse.com/migration), I run this command, as indicated, to check that things are working as expected:
curl -X POST \
-H "X-Parse-Application-Id: MY_APP_ID" \
-H "Content-Type: application/json" \
-d '{"score":1337,"playerName":"Sean Plott","cheatMode":false}' \
http://localhost:1337/parse/classes/GameScore
And I get this message:
{"code":119,"error":"Permission denied for action create on class GameScore."}
Where do I need to set the permissions, so that it is no more denied?
Related
No sure how this could happen but I am getting 404 errors where the request data in my sentry project makes no sense. The project is using CloudFlare for DNS then it goes through an AWS network.
curl \
-H "Accept: */*" \
-H "Content-Length: " \
-H "Content-Type: " \
-H "Host: ${ip}" \
-H "User-Agent: curl/7.64.1" \
-H "X-Amzn-Trace-Id: Root=[Filtered]" \
-H "X-Forwarded-For: [Filtered]" \
-H "X-Forwarded-Port: 443" \
-H "X-Forwarded-Proto: https" \
"http://${ip}/"
How can my project throw a 404 when the requests hitting it are http://${ip}/. I don't see how this request could resolve to the project.
What could be causing this?
How can this be resolving?
Is this an issue with CloudFlare or AWS?
I am trying to write a Bash script on my server (My Server) that will grab a file from one remote server (Source) and copy it to a Dropbox account (Destination). I need to get the file from Source via SFTP and will be copying it to Destination using the Dropbox API (HTTPS). So far I can get the file with:
curl -k "sftp://Source/file.txt" --user "me:mypasswd" -o "/test/file.txt" --ftp-create-dirs
and then copy it to Dropbox with
curl -X POST https://content.dropboxapi.com/2/files/upload \
--header "Authorization: Bearer " \
--header "Dropbox-API-Arg: {\"path\": \"/path/to/file.txt\",\"mode\": \"add\",\"autorename\": true,\"mute\": false,\"strict_conflict\": false}" \
--header "Content-Type: application/octet-stream" \
--data-binary #/test/file.txt
I'm guessing the "right" way to do this is to pipe the file from Source directly to Destination, but I'm just not sure how to go about putting them together.
This is definitely not my area of expertise, so I don't even know where to start - nested CURL calls? If anyone could point me in the right direction, I'd be most appreciative.
UPDATE
Here's the whole curl command I'm running:
curl -X POST https://content.dropboxapi.com/2/files/upload \
--header "Authorization: Bearer $token" \
--header "Dropbox-API-Arg: {\"path\": \"/xfer/chef.txt\",\"mode\": \"add\",\"autorename\": true,\"mute\": false,\"strict_conflict\": false}" \
--header "Content-Type: application/octet-stream" \
--data-binary "$(curl -k "http://marketing.dave0112.com/file.txt" --user "me:mypasswd")"
I was having issues with CURL not supporting SFTP so I changed to HTTP while i get that end sorted out. Not sure if that affects anything.
You can replace this line :
--data-binary #/test/file.txt
with
--data-binary #<(curl -k "sftp://Source/file.txt" --user "me:mypasswd")
If problems, try :
--data-binary "$(curl -k "sftp://Source/file.txt" --user "me:mypasswd")"
curl -u hadoop:123456 -H "Accept: application/json" -H "Content-type: application/json" -v -X PUT -d '{"state": "KILLED"}' "http://host:8088/ws/v1/cluster/apps/application_1575020200992_1673895/state"
I was already add the username and password, but return:
Unauthorized attempt to kill appid application_1575020200992_1673895 by remote user dr.who
What's dr.who ?
I figure out... add the user.name query string parameter.
like this:
curl -u hadoop:123456 -H "Accept: application/json" -H "Content-type: application/json" -v -X PUT -d '{"state": "KILLED"}' "http://host:8088/ws/v1/cluster/apps/application_1575020200992_1673895/state?user.name=hadoop"
http://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-common/HttpAuthentication.html
I want to download files(*.txt and *.pdf) from Ariba site through GET api request and want to automate the whole download process.
Initially I have used Postman for testing purpose which gives me result in the form of file content.
For eg. test.txt file is present on remote site, after GET request from Postman, the result I am getting, it is in form of content of file, so if 'abc' is written in file, I am getting 'abc' as response from test.txt file.
Now if I click on Send and Download button in Postman it gives me option to download file 'test.txt'
I have to automate this process to send GET response and get required file download at specific location. I am trying to use Curl script for this.
I have written corresponding Curl script and tried to execute it.
It gives me response in the form of file content.
curl -X GET \
'https://openapi.ariba.com/api/approval/v1/prod/invoices/INVASINV6-902/attachments/bnMyMDE5LzA0LzAzLzE1MjkyNDE4MQ==?realm=ProjectName&Content-Disposition=attachement' \
-H 'Accept: */*' \
-H 'Authorization: Bearer 7648d29a-db04-4046-b49c-5daed43a145c' \
-H 'Cache-Control: no-cache' \
-H 'Connection: keep-alive' \
-H 'Host: openapi.ariba.com' \
-H 'accept-encoding: gzip, deflate' \
-H 'apiKey: xxxxxxxxxxxxxxxxxx' \
-H 'cache-control: no-cache'
I want to write a curl script which will download file at specific location.
For eg. Above curl command give content(abc) from file Test.txt and not file Test.txt as output
Really appreciate your helpCurl Get Response
Postman Get Response
Finally I got answer to the question, I just need to remove -X GET from my curl script and at the end add -o to download file name.
Below is the final code:
curl 'https://openapi.ariba.com/api/approval/v1/prod/invoices/INVASINV6-902/attachments/bnMyMDE5LxxxxLzE1MjkyNDE4MQ==?realm=ProjectName' \
-H 'Accept: */*' \
-H 'Authorization: Bearer 77876887-xxxxx-42fb-b865-9cf8ff5c2b25' \
-H 'Cache-Control: no-cache' \
-H 'Connection: keep-alive' \
-H 'Host: openapi.ariba.com' \
-H 'accept-encoding: gzip, deflate' \
-H 'apiKey: XXXXXXXXXXXXXXXX' \
-H 'cache-control: no-cache' \
-H 'Content-Type: application/octet-stream' \
-H "Content-Transfer-Encoding: Binary" \
-o "Test.txt"
Above code give me file downloaded at specific location.
Thanks BlackPearl.
My code consists of the following:
curl -k -X DELETE \
-H "X-Parse-Application-Id: staticid" \
-H "X-Parse-Master-Key: statickey" \
https://mystatic.url/dynamicvalue
I have a list of URLS:
https://mystatic.url/johndylan
https://mystatic.url/marypoppins
etc, included in a tobedeleted.txt file and I would like to modify my cURL code to be something like this (which I've tried but didnt work:
curl -k -X DELETE \
-H "X-Parse-Application-Id: staticid" \
-H "X-Parse-Master-Key: statickey" \
> tobedeleted.txt
or to something like this (which also I've tried but it didnt worked)
curl -k -X DELETE \
-H "X-Parse-Application-Id: staticid" \
-H "X-Parse-Master-Key: statickey" \
https://mystatic.url/$tobedeleted.txt
Note that i want to run the same cURL command, each time for each line of the file, so I guess that I would need something like foreach function, since this is a bash script.
You are going to want something like this:
while read value
do
curl -k -X DELETE \
-H "X-Parse-Application-Id: staticid" \
-H "X-Parse-Master-Key: statickey" \
https://mystatic.url/$value
done < tobedeleted.txt