question

NitinS-1896 avatar image
0 Votes"
NitinS-1896 asked saldana-msft edited

Unable to add teams app in app catalog using Microsoft graph API

I want to upload my teams app package to catalog but i am not able to do it. I am following https://docs.microsoft.com/en-us/graph/api/teamsapp-publish?view=graph-rest-1.0&tabs=http

Please help

curl -F "data=@/home/Downloads/app_package.zip" -H "Authorization: Bearer user_token" -H "Content-length: 244" -H "Content-type: application/zip" -X POST https://graph.microsoft.com/v1.0/appCatalogs/teamsApps


Getting-

{"error":{"code":"BadRequest","message":"Invalid zip archive provided, ex: End of Central Directory record could not be found.","innerError":{"date":"2021-07-26T19:49:55","request-id":"f501141a-c74d-4df2-842a-e5f784732558","client-request-id":"f501141a-c74d-4df2-842a-e5f784732558"}}}

office-teams-app-devmicrosoft-graph-teamworkmicrosoft-graph-sdkmicrosoft-365-apps-publishing-dev
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Adding right tags/teams to assist

0 Votes 0 ·

1 Answer

Prasad-MSFT avatar image
0 Votes"
Prasad-MSFT answered NitinS-1896 commented

There are various reasons for this type error:

  1. The archive is corrupt.
    Solution - The archive will need repairing.

  2. It is not a .zip archive.
    It may be a .rar or other compressed type.
    Solution - Have to find a correct archive to use this code.

  3. There is more than 1 part to the archive.
    A multi part zip file.
    Solution - Read in all the files before decompression.

  4. The file may be hidden or have extended characters in the name.
    Solution - Check your file attributes/permissions and verify the file name.

Opening the file with your favorite zip/unzip utility (7-zip, winzip, etc) will tell which of these it could be.


Thanks,
Prasad Das


If the response is helpful, please click "Accept Answer" and upvote it. You can share your feedback via Microsoft Teams Developer Feedback link. Click here to escalate.

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Thanks for your answer. Found the error. I just need to open+read then send the file but i was only reading the file before sending.

0 Votes 0 ·