Skip to content
Herman Wong edited this page Dec 25, 2019 · 2 revisions

myProxy API

myProxy has an API that can be used for 3rd party sites to manage your domain

Calling the API

Authentication

This API uses Access Keys to authenticate requests.

The Access Keys are entered in the Header under Authentication.

Request Format

This API requires Content-Type: application/json for all POST requests

Endpoints

  1. GET api/mappings This endpoint returns all domain mappings.

     fetch('/api/mappings', {
     	method: 'GET',
     	headers: {
     		Authentication: 'YOUR_ACCESS_TOKEN_HERE`
     	}
     })
    
  2. POST api/mappings

    This endpoint creates a new domain mapping.

     fetch('/api/mappings', {
     	method: 'POST',
     	headers: {
     		authentication: 'YOUR_ACCESS_TOKEN_HERE',
     		'Content-Type': 'application/json'
     	},
     	body: JSON.stringify({
     		subdomain: 'your-subdomain',
     		domain: 'your-domain',
     		port: '6572', // This is optional
     		ip: '127.0.0.1' // this is optional
     	})
     })
    
  3. GET api/mappings/:id

    This endpoint fetches a domain mapping by id

     fetch('/api/mappings/your-mapping-id', {
     	method: 'GET',
     	headers: {
     		authentication: 'YOUR_ACCESS_TOKEN_HERE',
     	},
     })
    
  4. DELETE api/mappings/:id

    This endpoint deletes a domain mapping by id.

     fetch('/api/mappings/your-mapping-id', {
     	method: 'DELETE',
     	headers: {
     		authentication: 'YOUR_ACCESS_TOKEN_HERE',
     	}
     })
    
Clone this wiki locally