I am referring to the following documentation to create an API proxy through Edge Management API calls, but I don't find the format of JSON that needs to be submitted.
https://apidocs.apigee.com/management/apis/post/organizations/%7Borg_name%7D/apis
The document has information about the name field in the JSON, not anything else.
Solved! Go to Solution.
Here's how you can do it. (Pseudo-code)
:org = yourorgname :env = test POST :mgmtserver/v1/o/:org/apis Authorization: :edge-auth content-type: application/xml <APIProxy name='TestBundle'/>
POST :mgmtserver/v1/o/:org/apis/TestBundle/revisions/1/policies Authorization: :edge-auth content-type: application/xml <RaiseFault name='RF-BadRequest'> <IgnoreUnresolvedVariables>true</IgnoreUnresolvedVariables> <FaultResponse> <Set> <Payload contentType='text/plain'>error</Payload> <StatusCode>400</StatusCode> <ReasonPhrase>Bad Request</ReasonPhrase> </Set> </FaultResponse> </RaiseFault>
POST :mgmtserver/v1/o/:org/apis/TestBundle/revisions/1/policies Authorization: :edge-auth content-type: application/xml <AssignMessage name='AM-Response'> <AssignTo createNew='false' transport='http' type='response'></AssignTo> <IgnoreUnresolvedVariables>false</IgnoreUnresolvedVariables> <Set> <Payload contentType='text/plain'>OK</Payload> <StatusCode>200</StatusCode> <ReasonPhrase>OK</ReasonPhrase> </Set> </AssignMessage>
POST :mgmtserver/v1/o/:org/apis/TestBundle/revisions/1/proxies Authorization: :edge-auth content-type: application/xml <ProxyEndpoint name="endpoint1"> <Description></Description> <HTTPProxyConnection> <BasePath>/apibasepath</BasePath> <VirtualHost>secure</VirtualHost> </HTTPProxyConnection> <FaultRules/> <PreFlow name="PreFlow"> <Request/> <Response/> </PreFlow> <PostFlow name="PostFlow"> <Request/> <Response/> </PostFlow> <Flows> <Flow name='t1'> <Request> </Request> <Response> <Step><Name>AM-Response</Name></Step> </Response> <Condition>proxy.pathsuffix MatchesPath "/t1" and request.verb = "GET"</Condition> </Flow> <Flow name='unknown request'> <Request> <Step><Name>RF-BadRequest</Name></Step> </Request> <Response> </Response> </Flow> </Flows> <RouteRule name='noroute'/> </ProxyEndpoint>
You can attach target endpoints similarly. POST to the /targets collection. There is also a /resources collection to which you can POST XSD, WSDL, JAR, nodejs, etc.
POST :mgmtserver/ v1/ o/ :org/ e/ :env/ apis/ TestBundle/ revisions/ 1/ deployments ? action=deploy Authorization: :edge-auth Content-type: application/ x-www-form-urlencoded
You can also use JSON to format these various entities. Change the content-type headers if you do that.