microsoft-graph-apimicrosoft-teamsmicrosoft-graph-teamsmicrosoft-graph-files

Not able to publish Teams app zip package by 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://learn.microsoft.com/en-us/graph/api/teamsapp-publish?view=graph-rest-1.0&tabs=http

After executing curl request getting error-

{"error":{"code":"BadRequest","message":"Invalid zip archive provided, ex: End of Central Directory record could not be found.","innerError":{"date":"2021-07-26T16:43:48","request-id":"ea50c913-7fe5-4790-aa93-fc7955a57b50","client-request-id":"ea50c913-7fe5-4790-aa93-fc7955a57b50"}}}

Please help!!

Here is my curl request-

curl -F "data=@/home/dell/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?requiresReview=true'


Solution

  • " I was not reading the package correctly before sending it. After doing open and read operations then sending, it was working."