Content Publish API. Upload *.apk file

Hey! I need help with the Content Publish API. I want to upload an apk file (size 100 Mbyte). But I am getting an error message “HTTP 413 [text=HTTP content length exceeded 10485760 bytes.]” when uploading a file using the “POST/seller/fileUpload” method.

Can I upload large files using the Content Publish API?

Hi Aleksandr9

Here is what the store operations team said…

10485760 is only 10MB, we tested a ~90MB file with the Dev API and it uploaded with no issue, took some time to finish but it eventually did.

Could you share the exact command they are using?

Ron
Samsung Developer Relations

Hi Ron!

Thanks for your answer.

Creating access token - https://devapi.samsungapps.com/auth/accessToken
Creating upload session - https://devapi.samsungapps.com/seller/createUploadSessionId
File uploading - https://devapi.samsungapps.com/seller/fileUpload

I created an app in Kotlin + Retrofit2.

Code fragment
           { uploadSession -> val file = File(pathFile) // pathFile = ""/Users/aleksandr/Downloads/artifacts-4/app_3_51_1_328.apk""
            val requestFile = RequestBody.create("multipart/form-data".toMediaTypeOrNull(), file)
            val body = MultipartBody.Part.createFormData("file", file.name, requestFile)

            return@flatMap samsungApi.fileUpload(
                "Bearer $accessToken",
                SERVICE_ACCOUNT_ID,
                checkNotNull(uploadSession.sessionId),
                body
            )
        }
SamsungApi.kt
@Multipart
@POST("seller/fileUpload")
    fun fileUpload(
        @Header("Authorization") accessToken: String,
        @Header("service-account-id") serviceAccountId: String,
        @Query("sessionId") sessionId: String,
        @Part file: MultipartBody.Part
    ): Single<FileUploadDto>
Response log
апр. 15, 2022 11:45:22 AM okhttp3.internal.platform.Platform log
INFO: --> END POST (99867470-byte body)
апр. 15, 2022 11:45:34 AM okhttp3.internal.platform.Platform log
INFO: <-- 413 https://devapi.samsungapps.com/seller/fileUpload?sessionId=********-****-****-****-************ (12169ms)
апр. 15, 2022 11:45:34 AM okhttp3.internal.platform.Platform log
INFO: content-type: text; charset=utf-8
апр. 15, 2022 11:45:34 AM okhttp3.internal.platform.Platform log
INFO: content-length: 44
апр. 15, 2022 11:45:34 AM okhttp3.internal.platform.Platform log
INFO: date: Fri, 15 Apr 2022 08:45:25 GMT
апр. 15, 2022 11:45:34 AM okhttp3.internal.platform.Platform log
INFO: x-cache: Error from cloudfront
апр. 15, 2022 11:45:34 AM okhttp3.internal.platform.Platform log
INFO: via: 1.1 752474607e5162b3278b647bb0ff3808.cloudfront.net (CloudFront)
апр. 15, 2022 11:45:34 AM okhttp3.internal.platform.Platform log
INFO: x-amz-cf-pop: HEL50-C1
апр. 15, 2022 11:45:34 AM okhttp3.internal.platform.Platform log
INFO: x-amz-cf-id: 55sq_****==
апр. 15, 2022 11:45:34 AM okhttp3.internal.platform.Platform log
INFO: 
апр. 15, 2022 11:45:34 AM okhttp3.internal.platform.Platform log
INFO: HTTP content length exceeded 10485760 bytes.
апр. 15, 2022 11:45:34 AM okhttp3.internal.platform.Platform log
INFO: <-- END HTTP (44-byte body)

Good afternoon :wave:
How to publish wallpaper to the store?

Only Theme Partners can upload content to the Theme Store that includes Free items and Wallpapers as well as Themes. See this Page on how to apply for a Theme seller Partnership. Be aware that thousands apply and only a few handful are approved. There is a Blog How to Become a Samsung Mobile UI Themes Designer by Tony Morelan that tells you how to prepare your resources.

Hope that helps,

Ron
Samsung Developer Relations

Ron
Samsung Developer Relations

I’ve got a problem with the very first step: /auth/accessToken responds with HTTP 500 Internal Server Error and the following response body: {"message":"Cannot destructure property 'iss' of '(intermediate value)(intermediate value)(intermediate value)' as it is undefined."}
Of course, i’ve got the mentioned iss field in the JWT token body, so the error message is irrelevant.

I got notified that there is an issue with logging into many Samsung sites now it started about 12 hours ago. (They are updating the login process) please give this a few hours and try again.

Ron
Samsung Developer Relations

Nothing has changed, unfortunately.

It actually has gotten worse. And it is affecting North and South America. We asked that this be escalated.

Ron
Samsung Developer Relations