Managment API to replace (delete/add or update) flow in a proxy

I am looking for a management API to read and update a proxy configuration (Proxy endpoint XML) – is there one? The use case is to generate some policy artifacts and attach them to the proxy endpoint flow. I am trying to avoid replacing the whole bundle. I just need to replace the flow/proxy endpoint configuration XML. Thanks in advance.

You should be able to do it with Management APIs using PUT request 

Lets say you have an API whose target end point you want to change :

GET : [https://api.enterprise.apigee.com/v1/o/yourorg/apis/yourapi/revisions/1/targets/default](https://api.enterprise.apigee.com/v1/o/yourorg/apis/yourapi/revisions/1/targets/default)
	
Headers : 

Authorization : Basic <your basic>

Response :
	

{
  "connection" : {
    "connectionType" : "httpConnection",
    "uRL" : "http://www.google.com"
  },
  "connectionType" : "httpConnection",
  "description" : "",
  "faultRules" : [ ],
  "flows" : [ ],
  "name" : "default",
  "postFlow" : {
    "name" : "PostFlow",
    "request" : {
      "children" : [ ]
    },
    "response" : {
      "children" : [ ]
    }
  },
  "preFlow" : {
    "name" : "PreFlow",
    "request" : {
      "children" : [ ]
    },
    "response" : {
      "children" : [ ]
    }
  },
  "type" : "Target"
}

To change the target end point from [www.google.com](www.google.com) to [www.yahoo.com](www.yahoo.com) , you can issue a PUT request .
	

PUT  [https://api.enterprise.apigee.com/v1/o/yourorg/apis/yourapi/revisions/1/targets/default](https://api.enterprise.apigee.com/v1/o/yourorg/apis/yourapi/revisions/1/targets/default) 

Headers : 

Authorization : Basic <your basic>
Content-Type : application/json

Body :

{
  "connection": {
    "connectionType": "httpConnection",
    "uRL": "http://www.yahoo.com"
  },
  "connectionType": "httpConnection",
  "description": "",
  "faultRules": [],
  "flows": [],
  "name": "default",
  "postFlow": {
    "name": "PostFlow",
    "request": {
      "children": []
    },
    "response": {
      "children": []
    }
  },
  "preFlow": {
    "name": "PreFlow",
    "request": {
      "children": []
    },
    "response": {
      "children": []
    }
  },
  "type": "Target"
}

Response :

{
  "connection" : {
    "connectionType" : "httpConnection",
    "uRL" : "http://www.yahoo.com"
  },
  "connectionType" : "httpConnection",
  "description" : "",
  "faultRules" : [ ],
  "flows" : [ ],
  "name" : "default",
  "postFlow" : {
    "name" : "PostFlow",
    "request" : {
      "children" : [ ]
    },
    "response" : {
      "children" : [ ]
    }
  },
  "preFlow" : {
    "name" : "PreFlow",
    "request" : {
      "children" : [ ]
    },
    "response" : {
      "children" : [ ]
    }
  },
  "type" : "Target"
}

1 Like

Great! thanks.

@Rajesh Mishra

where is it documented? could you please redirect me to it?