Skip to content

REST API

Tyler Ayers edited this page Oct 17, 2025 · 1 revision

Sample REST calls

# go to the test data directory in the cloned repository
cd test/templates

# create an empty template
curl -X POST "http://localhost:8080/templates?name=AI-Proxy-v1" \
  -H "Accept: application/json"

# import an Apigee proxy ZIP to JSON template, template is saved on the server and returned
curl -X POST "http://localhost:8080/templates?name=SimpleProxy-v1" \
	-H "Content-Type: application/octet-stream" \
	-H "Accept: application/json" \
	--data-binary "@SimpleProxy-v1.zip"

# get a template as Apigee proxy ZIP, save to file SimpleProxy-v1.zip
curl "http://localhost:8080/templates/SimpleProxy-v1" \
	-H "Accept: application/octet-stream" \
	-o "SimpleProxy-v1.zip"

# import a local feature JSON file to the server
cd ../features
curl -X POST "http://localhost:8080/features?name=auth-apikey-header" \
	-H "Content-Type: application/json" \
	-H "Accept: application/json" \
	--data-binary "@auth-apikey-header.json"

# import apigee proxy Gemini-v1 as feature
curl -X POST "http://localhost:8080/features?org=apigee-prod13&proxy=Gemini-v1" \
    -H "Authorization: Bearer $(gcloud auth print-access-token)"

# add feature to template, updated template is saved and returned
curl -X POST "http://localhost:8080/templates/SimpleProxy-v1/features/auth-apikey-header" \
	-H "Accept: application/json"

# remove feature from template, updated template is saved and returned
curl -X DELETE "http://localhost:8080/templates/SimpleProxy-v1/features/auth-apikey-header" \
	-H "Accept: application/json"

Clone this wiki locally