Publish api '/v1/assets/upload' Return does not have permission

I want to upload image from api.
so im trying to upload image using api, but it return error.

{"AssetDetails":[{"assetFileName":"Test.png","uploadAssetError":"UserDoesNotHavePermissionToUpload"}]}

Header have cookie and CSRF-Token, is this command wrong?

>curl -X POST --header "Content-Type: multipart/form-data" --header "Accept: application/json" --header "Cookie: #REMOVED FOR SECURITY#" --header "X-CSRF-TOKEN: #REMOVED FOR SECURITY#" -F Config=@config.json -F Test=@Test.png "https://publish.roblox.com/v1/assets/upload" --verbose
Note: Unnecessary use of -X or --request, POST is already inferred.
*   Trying 128.116.120.3...
* TCP_NODELAY set
* Connected to publish.roblox.com (128.116.120.3) port 443 (#0)
* schannel: SSL/TLS connection with publish.roblox.com port 443 (step 1/3)
* schannel: checking server certificate revocation
* schannel: sending initial handshake data: sending 189 bytes...
* schannel: sent initial handshake data: sent 189 bytes
* schannel: SSL/TLS connection with publish.roblox.com port 443 (step 2/3)
* schannel: failed to receive handshake, need more data
* schannel: SSL/TLS connection with publish.roblox.com port 443 (step 2/3)
* schannel: encrypted data got 4096
* schannel: encrypted data buffer: offset 4096 length 4096
* schannel: encrypted data length: 4022
* schannel: encrypted data buffer: offset 4022 length 4096
* schannel: received incomplete message, need more data
* schannel: SSL/TLS connection with publish.roblox.com port 443 (step 2/3)
* schannel: encrypted data got 415
* schannel: encrypted data buffer: offset 4437 length 5046
* schannel: sending next handshake data: sending 93 bytes...
* schannel: SSL/TLS connection with publish.roblox.com port 443 (step 2/3)
* schannel: encrypted data got 258
* schannel: encrypted data buffer: offset 258 length 5046
* schannel: SSL/TLS handshake complete
* schannel: SSL/TLS connection with publish.roblox.com port 443 (step 3/3)
* schannel: stored credential handle in session cache
> POST /v1/assets/upload HTTP/1.1
> Host: publish.roblox.com
> User-Agent: curl/7.55.1
> Accept: application/json
> Cookie: #REMOVED FOR SECURITY#
> X-CSRF-TOKEN: #REMOVED FOR SECURITY#
> Content-Length: 28061
> Expect: 100-continue
> Content-Type: multipart/form-data; boundary=------------------------db0e49461ab16ff9
>
* schannel: client wants to read 102400 bytes
* schannel: encdata_buffer resized 103424
* schannel: encrypted data buffer: offset 0 length 103424
* schannel: encrypted data got 54
* schannel: encrypted data buffer: offset 54 length 103424
* schannel: decrypted data length: 25
* schannel: decrypted data added: 25
* schannel: decrypted data cached: offset 25 length 102400
* schannel: encrypted data buffer: offset 0 length 103424
* schannel: decrypted data buffer: offset 25 length 102400
* schannel: schannel_recv cleanup
* schannel: decrypted data returned 25
* schannel: decrypted data buffer: offset 0 length 102400
< HTTP/1.1 100 Continue
* schannel: client wants to read 102400 bytes
* schannel: encrypted data buffer: offset 0 length 103424
* schannel: encrypted data got 451
* schannel: encrypted data buffer: offset 451 length 103424
* schannel: decrypted data length: 422
* schannel: decrypted data added: 422
* schannel: decrypted data cached: offset 422 length 102400
* schannel: encrypted data buffer: offset 0 length 103424
* schannel: decrypted data buffer: offset 422 length 102400
* schannel: schannel_recv cleanup
* schannel: decrypted data returned 422
* schannel: decrypted data buffer: offset 0 length 102400
< HTTP/1.1 200 OK
< cache-control: no-cache
< pragma: no-cache
< content-type: application/json; charset=utf-8
< expires: -1
< x-frame-options: SAMEORIGIN
< roblox-machine-id: CHI1-WEB2979
< p3p: CP="CAO DSP COR CURa ADMa DEVa OUR IND PHY ONL UNI COM NAV INT DEM PRE"
< date: Thu, 10 Sep 2020 01:38:01 GMT
< content-length: 102
<
{"AssetDetails":[{"assetFileName":"Test.png","uploadAssetError":"UserDoesNotHavePermissionToUpload"}]}* Connection #0 to host publish.roblox.com left intact
1 Like

Your cookie may be outdated.

Also, what language is this, if even code?
Looks like Linux.

Could we have a bit more context on what your trying to accomplish with this?

Also make sure “Test.png” exists in the directory your running from.

No, I use the latest cookies.

I want upload asset (image) from api.

Yes, Test.png exists.

Files: ImageUploadTest.zip (10.0 KB)

Please try not to repost topics. You can update your original thread with information.

No, it’s not a repost of it…
Reposted because it was flagged off topic

https://devforum.roblox.com/t/publish-api-v1-assets-upload-return-does-not-have-permission/764015?u=dollychun

I’m not an expert in HTTP requests, but it sounds like you don’t have permission to send requests to roblox.com, and this is probably why:
Trust check failed - HTTPService - #7 by VladTheFirst

It is impossible to post this API on the server.
Because I’m uploading a file.
And it’s definitely not because json is returned.

It is impossible to post this API on the server.
Because I’m uploading a file.

Sorry, I don’t understand. Are you sending a request from a Roblox place or somewhere else?

No, because cannot send a file with an HTTP request from the roblox server.

1 Like