beReal-api icon indicating copy to clipboard operation
beReal-api copied to clipboard

Issue with post/upload/data

Open ghost opened this issue 2 years ago • 6 comments

Getting the error shown below while trying to execute the post/upload/data (step 3) request. Do you know why I am getting this error? Step 1 and 2 work as expected. Have i put some wrong information in "postData"?

My request body: { "postData": { "resize": false, "late": true, "visibility": "friends", "retakes": 0, "caption": "Hello", "taken_at": "2024-01-14T16:14:51.123Z", "location": "[48.864716, 2.349014]" }, "tokenData": "here is my postDataToken" }

This is what the server responses: { "status": 500, "message": "Internal server error", "data": { "response": { "status": 400, "message": "Post not created", "data": { "done": false, "msg": { "message": "Request failed with status code 400", "name": "AxiosError", "stack": "AxiosError: Request failed with status code 400\n at settle (/app/node_modules/axios/dist/node/axios.cjs:1970:12)\n at IncomingMessage.handleStreamEnd (/app/node_modules/axios/dist/node/axios.cjs:3069:11)\n at IncomingMessage.emit (node:events:531:35)\n at endReadableNT (node:internal/streams/readable:1696:12)\n at process.processTicksAndRejections (node:internal/process/task_queues:82:21)", "config": { "transitional": { "silentJSONParsing": true, "forcedJSONParsing": true, "clarifyTimeoutError": false }, "adapter": [ "xhr", "http" ], "transformRequest": [ null ], "transformResponse": [ null ], "timeout": 0, "xsrfCookieName": "XSRF-TOKEN", "xsrfHeaderName": "X-XSRF-TOKEN", "maxContentLength": -1, "maxBodyLength": -1, "env": {}, "headers": { "Accept": "application/json, text/plain, /", "Content-Type": "application/json", "Authorization": "Bearer censored", "user-agent": "BeReal/1.0.1 (AlexisBarreyat.BeReal; build:9513; iOS 16.0.2) 1.0.0/BRApriKit", "x-ios-bundle-identifier": "AlexisBarreyat.BeReal", "Content-Length": "442", "Accept-Encoding": "gzip, compress, deflate, br" }, "method": "post", "url": "https://mobile.bereal.com/api/content/posts", "data": "{"isLate":true,"retakeCounter":0,"takenAt":"2024-01-14T16:14:51.123[Z]","caption":"Hello","visibility":["friends"],"backCamera":{"bucket":"storage.bere.al","height":2000,"width":1500,"path":"Photos/censored/post/censored.webp"},"frontCamera":{"bucket":"storage.bere.al","height":2000,"width":1500,"path":"Photos/censored/post/censored.webp"},"location":{"latitude":"[","longitude":"4"}}" }, "code": "ERR_BAD_REQUEST", "status": 400 } } }, "status": 400, "message": "Post not created", "name": "HttpException" } } I replaced private stuff with "censored".

ghost avatar Jan 14 '24 16:01 ghost

Hey! The post upload endpoints actually are giving some issues. Maybe the error is in the caption, idk, can you try it without caption to see what returns?

chemokita13 avatar Jan 18 '24 11:01 chemokita13

I get the same error without the caption

TomCasavant avatar Jan 22 '24 01:01 TomCasavant

If it helps, when I don't pass in the values as json it successfully posts the bereal except it doesn't have either image (caption/location/visibility all work)

image

e.g.: This posts without any images:

    url = base_url + "/post/upload/data"
    post_data = {"resize":"...", "late":"...", ... }
    headers = {"token":self.jwt_token, "accept": "application/json"}
    data = {"postData": post_data, "tokenData": token_data}
    response = requests.post(url, headers=headers,  data=data)

And this gives the Request failed with status code 400 error

    url = base_url + "/post/upload/data"
    post_data = {"resize":"...", "late":"...", ... }
    headers = {"token":self.jwt_token, "accept": "application/json"}
    data = {"postData": post_data, "tokenData": token_data}
    response = requests.post(url, headers=headers, json=data)

TomCasavant avatar Jan 26 '24 19:01 TomCasavant

I will work on it!

chemokita13 avatar Jan 26 '24 21:01 chemokita13

Any update on this?

3eif avatar Mar 23 '24 20:03 3eif

Any update on this?

I am working on it! I think it wont be more than 4 or 5 days

chemokita13 avatar Mar 27 '24 14:03 chemokita13