Link Search Menu Expand Document

Publics APIs

The Micro Platform makes your services available via a public http/json API.

Query and access your services in the following ways.


The public APIs for the Platform


Your Services



Namespaces are a unique isolated space provided for you and your collaborators.

# get your namespace
micro user namespace


Most of our core services are locked down so you’ll need to use an API token to access them.

# get your user token`
MICRO_API_TOKEN=`micro user token`

# curl the api
curl -H "Authorization: Bearer $MICRO_API_TOKEN"

You should see below or thereabouts

{"version": "v3.0.0-beta"}

Generating API Tokens

This section is coming soon but you can otherwise use your own user token for now.

Request Mapping

Because all services are RPC based, HTTP requests have to be dynamically mapped to services and their endpoints. We do this very simply in the manner shown below.

# Call helloworld service with Helloworld.Call endpoint

# Call hellworld service with Greeting.Message endpoint

As you can see if an endpoint matches the service name we can collapse the path so there’s no redundancy. We additionally map the Call endpoint much like index.html for the web so that you can simply do

A convenient hack just like the web.

Setting Namespace

Because your services are in a specific namespace you’ll have to set the Micro-Namespace header to access them via our public api You otherwise also get a custom url per namespace which you can read about below.

To get your namespace

NAMESPACE=`micro user namespace`

Then simply set as the header in your call

curl -H "Micro-Namespace: $NAMESPACE"

This will route to your helloworld service as opposed to someone else’s!

Custom URLs

Each user gets a custom URL based on their namespace which is https://[namespace]

Each of your services is then path based e.g https://[namespace][service].

For example to route to the helloworld service in the foobar namespace you would do



Your namespace is managed by your own set of rules which you can read about in the Authorization guide soon or just head to the Authentication tutorial.

Copyright © 2020 Micro Services, Inc.