Data API

API Quickstart

Used for sending data on Woosmap servers

Presentation

Public and Private keys

When You sign up you will receive a pair of keys.

key Description
private_key1 used in server api calls (POST, PUT and DELETE) where modification of the data occurs.
public_key used client side to fetch your project data.

REST API

Where possible the API strives to use appropriate HTTP verbs for each action.

Verb Description
GET Used for retrieving resources.
POST Used for creating resources.
PUT Used for replacing resources or collections.
DELETE Used for deleting resources.

Error Handling

Code Description
20X Indicates success or object creation.
403 if Unauthorized
400 if the request data is wrong.

Additionally the answer might contain a message key, with an human error message as value.

Structure of requests

All data sent and received are in JSON format.

Data sent

The data sent through POST and PUT methods should be in the following format:

{
    "stores": [{"storeId": "0"...}]
}

Each element of the stores array must be in the format explained here .

Managing assets data

The restrictions on POST and PUT on storeIds are made to ensure identifier stability.

Create assets data

Used to create assets in batch.

Warning: storeId must not exists when using POST method, if one store already exists, the batch will be refused.

curl -X POST \
	-H 'Content-Type: application/json' \
	-d @data.json \
	'https://api.woosmap.com/stores?private_key={private_key}'

Updating assets data

Used to update assets in batch.

Warning: storeId must exists when using PUT method, if one asset does not exists, the batch will be refused.

curl -X PUT \
	-H 'Content-Type: application/json' \
	-d @data.json \
	'https://api.woosmap.com/stores?private_key={private_key}'

Deleting an asset

You can delete an asset using the following url, the storeId is the id you defined.

curl -X DELETE \
	'https://api.woosmap.com/stores/{storeId}?private_key={private_key}'

Replace all assets

You can replace all assets of a Project using the following url.

curl -X POST \
	-H 'Content-Type: application/json' \
	-d @data.json \
	'https://api.woosmap.com/stores/replace?private_key={private_key}'

This command will delete all previous assets and import assets from the json file.

During the operation previous assets could always be displayed on map.

If the import failed previous assets will not be deleted.

  1. The private key holds destructive power hence it should remain private, the public key can be made public since it’s used client side.