Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with post/upload/data #27

Open
ghost opened this issue Jan 14, 2024 · 6 comments
Open

Issue with post/upload/data #27

ghost opened this issue Jan 14, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@ghost
Copy link

ghost commented Jan 14, 2024

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".

@chemokita13
Copy link
Owner

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 chemokita13 added the question Further information is requested label Jan 18, 2024
@TomCasavant
Copy link

I get the same error without the caption

@TomCasavant
Copy link

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)

@chemokita13
Copy link
Owner

I will work on it!

@chemokita13 chemokita13 added bug Something isn't working and removed question Further information is requested labels Jan 26, 2024
@3eif
Copy link

3eif commented Mar 23, 2024

Any update on this?

@chemokita13
Copy link
Owner

Any update on this?

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants