Unable to export API Shared Flow from CURL

Not applicable

Unable to export API Shared flows using CURL.

I am unable to export the Shared flow xml to a local path using below command -

curl "<APIGEE PRIVATE CLOUD URI>/v1/organizations/<ORG NAME>/sharedflows/<SHARED_FLOW_NAME>/revisions/1?format=bundle" -u "UserEmailId:Password" -o "E:\APIGEE\DownloadedProxy\<SHARED_FLOW_NAME.zip>"

Can you suggest me how to export the shared flow in APIGEE using CURL.

1 1 176
1 REPLY 1

it works for me from MacOS.

$ curl -s -n $mgmtserver/v1/o/${org}/sharedflows/fetchGCPToken/revisions/1?format=bundle --output foo.zip
$ unzip -l foo.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
      502  03-06-2018 19:58   sharedflowbundle/policies/ExtractGCPToken.xml
      610  03-06-2018 19:58   sharedflowbundle/policies/calloutGCPAuth.xml
      216  03-06-2018 19:58   sharedflowbundle/sharedflows/default.xml
      777  03-06-2018 19:58   sharedflowbundle/fetchGCPToken.xml
---------                     -------
     2105                     4 files

I don't know curl on windows. On a unix system, I need to pass the -s option to tell curl to be "silent" so that the HTTP Headers don't get appended to the output file. Otherwise, the zip file will have http text at the beginning of the file. Maybe there is a corresponding --silent option for curl on windows.

Another option is to use the Powershell module for Apigee Edge.

Export-EdgeSharedFlow -Name my-sharedflow -Revision 1