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

Hi, I am experiencing the same issue. Is there any workaround?

@samet

This is a very old thread with several issues. Can you explain more…

If you can’t upload an Android .apk file it is probably because you have not submitted a DUNS number to verify your business.

If it is Themes or Watch Face please give more details. Better still open a new topic on this.

Ron
Samsung Developer Relations

@r.liechty_SDP
We are a company which have an galaxy app store and sell app items through galaxy app store. Till this time, we upload apk files manually without any problem. How uploading through API is different than manual upload in terms of permission. And how can I check If I submit DUNS number using my Galaxy Store Seller Portal.

Please note the DUNS entry system is under maintenance .

You need to manually sign into the Galaxy Store there will be a notice where you submit your DUNS number if necessary. If you didn’t submit it when you originally signed up to be a commercial seller then it probably is necessary.

If you are having an issue using the Galaxy Store API you should open a Developer Support Request they should be able to help you better than the Seller Portal contact us help.

Ron
Samsung Developer Relations

Hey, back to the other issue from this thread.
I experience {'message': "Cannot destructure property 'iss' of '(intermediate value)(intermediate value)(intermediate value)' as it is undefined."} like @gorunov_mikhail had.
The Developer Relations representative said this was due to some issue with logging in. This was a year ago, and I now can’t get my access token for a week.

@richard_sugma

Generally but not always when we see the 500 error it is with the Multi Factor Authorization
Try going to samsung.com and signing in to that first.

If that isn’t the issue can you create a different thread and I can have one of the Store Ops team that is more familiar with the Store API help you.

Ron
Samsung Developer Relations