简体   繁体   中英

Parse server aws REST API error

I created new parse server in amazon using bitnami image with parse dashboard, everything works fine but I am unable to connect parse REST api it throws error,

{"error":"unauthorized"}

I tried it with postman app

in my header

appId: ********************..
masterKey: *****************..

I send GET Request to this url

http://ec2-**-***-***-***.us-west-2.compute.amazonaws.com/parse/api/1/classes/_User

but it doesn't works.

two problems:

  1. unless you have configured your parse server to include api/1 in the request uri, they don't belong there. The paths are a little different than parse.com.

  2. you are using the wrong http headers.

Here's a curl that should work for you:

curl https://your.server:port/parse/classes/_User -H "x-parse-application-id: XXX" -H "x-parse-master-key: XXX"

Note that the path is: parse/classes/_User

And that the auth headers are: x-parse-application-id & x-parse-master-key

The good news is that the server response you are getting lets you know that parse-server is up and running and that's a big step ;)

Hope that helps!

You can try it like this:

curl -X PUT \
-H "X-Parse-Application-Id: ${APPLICATION_ID}" \
-H "X-Parse-REST-API-Key: ${REST_API_KEY}" \
-H "Content-Type: application/json" \
-d '{"your_field":"your_data"}' \
https://api.parse.com/1/classes ##your url

Though New Parse Server do not require REST_API_KEY, using REST_API_KEY sometimes solve the problem. For Further reading please refer https://parseplatform.github.io/docs/rest/guide/#objects-creating-objects

I created new parse server in amazon using bitnami image with parse dashboard

I will suggest not to use bitnami image because when I was using this image a lot of features couldn't be used.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM