Sample Input structure of an asset
A more complete store input JSON data
The API Takes a valid JSON with assets data as input. Here is a sample of what is expected from Woosmap Data API.
Assets Collection Request
{
"stores": [
{
"types": [
"drive",
"click_and_collect"
],
"tags": [
"wifi",
"covered_parking"
],
"location": {
"lat": 38.719,
"lng": -77.1067
},
"storeId": "STORE_ID_123456",
"name": "My Cool Store",
"address": {
"lines": [ "Building Centre", "26 Store Street" ],
"countryCode": "UK",
"city": "London",
"zipcode": "WC1E 7BT"
},
"contact": {
"website": "https://www.woosmap.com",
"phone": "+44 20 7693 4000",
"email": "[email protected]"
},
"userProperties": {
"some_user_properties": "associated user value"
},
"openingHours": {
"timezone": "Europe/London",
"usual": {
"default": [
{
"start": "08:30",
"end": "22:00"
}
],
"1": [ ]
},
"special": {
"2015-02-07": [
{
"start": "08:00",
"end": "23:00"
}
]
}
}
},
{
"types": [
"drive"
],
"tags": [
"covered_parking"
],
"location": {
"lat": 38.5239,
"lng": -77.0157
},
"storeId": "STORE_ID_45678",
"name": "My Cool Store 2",
"address": {
"lines": [ "1805-1899", "Orchard St" ],
"countryCode": "US",
"city": "Alexandria",
"zipcode": "22309"
},
"contact": {
"website": "https://www.woosmap.com",
"phone": "+44 20 7693 4000",
"email": "[email protected]"
},
"userProperties": {
"some_user_properties": "associated user value"
},
"openingHours": {
"timezone": "America/New_York",
"usual": {
"default": [
{
"start": "08:30",
"end": "22:00"
}
],
"1": [ ]
}
}
}
]
}
The following example create the above JSON assets using a POST
method:
Upload Sample
https://api.woosmap.com/stores
?private_key=YOUR_PRIVATE_API_KEY
curl -L -X POST 'https://api.woosmap.com/stores?private_key=YOUR_PRIVATE_API_KEY' \
-H 'content-type: application/json' \
--data-raw '{
"stores": [
{
"types": [
"drive",
"click_and_collect"
],
"tags": [
"wifi",
"covered_parking"
],
"location": {
"lat": 38.719,
"lng": -77.1067
},
"storeId": "STORE_ID_123456",
"name": "My Cool Store",
"address": {
"lines": [
"Building Centre",
"26 Store Street"
],
"countryCode": "UK",
"city": "London",
"zipcode": "WC1E 7BT"
},
"contact": {
"website": "https://www.woosmap.com",
"phone": "+44 20 7693 4000",
"email": "[email protected]"
},
"userProperties": {
"some_user_properties": "associated user value"
},
"openingHours": {
"timezone": "Europe/London",
"usual": {
"1": [],
"default": [
{
"start": "08:30",
"end": "22:00"
}
]
},
"special": {
"2015-02-07": [
{
"start": "08:00",
"end": "23:00"
}
]
}
}
},
{
"types": [
"drive"
],
"tags": [
"covered_parking"
],
"location": {
"lat": 38.5239,
"lng": -77.0157
},
"storeId": "STORE_ID_45678",
"name": "My Cool Store 2",
"address": {
"lines": [
"1805-1899",
"Orchard St"
],
"countryCode": "US",
"city": "Alexandria",
"zipcode": "22309"
},
"contact": {
"website": "https://www.woosmap.com",
"phone": "+44 20 7693 4000",
"email": "[email protected]"
},
"userProperties": {
"some_user_properties": "associated user value"
},
"openingHours": {
"timezone": "America/New_York",
"usual": {
"1": [],
"default": [
{
"start": "08:30",
"end": "22:00"
}
]
}
}
}
]
}'
var axios = require('axios');
var data = JSON.stringify({
"stores": [
{
"types": [
"drive",
"click_and_collect"
],
"tags": [
"wifi",
"covered_parking"
],
"location": {
"lat": 38.719,
"lng": -77.1067
},
"storeId": "STORE_ID_123456",
"name": "My Cool Store",
"address": {
"lines": [
"Building Centre",
"26 Store Street"
],
"countryCode": "UK",
"city": "London",
"zipcode": "WC1E 7BT"
},
"contact": {
"website": "https://www.woosmap.com",
"phone": "+44 20 7693 4000",
"email": "[email protected]"
},
"userProperties": {
"some_user_properties": "associated user value"
},
"openingHours": {
"timezone": "Europe/London",
"usual": {
"1": [],
"default": [
{
"start": "08:30",
"end": "22:00"
}
]
},
"special": {
"2015-02-07": [
{
"start": "08:00",
"end": "23:00"
}
]
}
}
},
{
"types": [
"drive"
],
"tags": [
"covered_parking"
],
"location": {
"lat": 38.5239,
"lng": -77.0157
},
"storeId": "STORE_ID_45678",
"name": "My Cool Store 2",
"address": {
"lines": [
"1805-1899",
"Orchard St"
],
"countryCode": "US",
"city": "Alexandria",
"zipcode": "22309"
},
"contact": {
"website": "https://www.woosmap.com",
"phone": "+44 20 7693 4000",
"email": "[email protected]"
},
"userProperties": {
"some_user_properties": "associated user value"
},
"openingHours": {
"timezone": "America/New_York",
"usual": {
"1": [],
"default": [
{
"start": "08:30",
"end": "22:00"
}
]
}
}
}
]
});
var config = {
method: 'post',
url: 'https://api.woosmap.com/stores?private_key=YOUR_PRIVATE_API_KEY',
headers: {
'content-type': 'application/json'
},
data : data
};
axios(config)
.then(function (response) {
console.log(JSON.stringify(response.data));
})
.catch(function (error) {
console.log(error);
});
import requests
import json
url = "https://api.woosmap.com/stores?private_key=YOUR_PRIVATE_API_KEY"
payload = json.dumps({
"stores": [
{
"types": [
"drive",
"click_and_collect"
],
"tags": [
"wifi",
"covered_parking"
],
"location": {
"lat": 38.719,
"lng": -77.1067
},
"storeId": "STORE_ID_123456",
"name": "My Cool Store",
"address": {
"lines": [
"Building Centre",
"26 Store Street"
],
"countryCode": "UK",
"city": "London",
"zipcode": "WC1E 7BT"
},
"contact": {
"website": "https://www.woosmap.com",
"phone": "+44 20 7693 4000",
"email": "[email protected]"
},
"userProperties": {
"some_user_properties": "associated user value"
},
"openingHours": {
"timezone": "Europe/London",
"usual": {
"1": [],
"default": [
{
"start": "08:30",
"end": "22:00"
}
]
},
"special": {
"2015-02-07": [
{
"start": "08:00",
"end": "23:00"
}
]
}
}
},
{
"types": [
"drive"
],
"tags": [
"covered_parking"
],
"location": {
"lat": 38.5239,
"lng": -77.0157
},
"storeId": "STORE_ID_45678",
"name": "My Cool Store 2",
"address": {
"lines": [
"1805-1899",
"Orchard St"
],
"countryCode": "US",
"city": "Alexandria",
"zipcode": "22309"
},
"contact": {
"website": "https://www.woosmap.com",
"phone": "+44 20 7693 4000",
"email": "[email protected]"
},
"userProperties": {
"some_user_properties": "associated user value"
},
"openingHours": {
"timezone": "America/New_York",
"usual": {
"1": [],
"default": [
{
"start": "08:30",
"end": "22:00"
}
]
}
}
}
]
})
headers = {
'content-type': 'application/json'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"stores\": [\n {\n \"types\": [\n \"drive\",\n \"click_and_collect\"\n ],\n \"tags\": [\n \"wifi\",\n \"covered_parking\"\n ],\n \"location\": {\n \"lat\": 38.719,\n \"lng\": -77.1067\n },\n \"storeId\": \"STORE_ID_123456\",\n \"name\": \"My Cool Store\",\n \"address\": {\n \"lines\": [\n \"Building Centre\",\n \"26 Store Street\"\n ],\n \"countryCode\": \"UK\",\n \"city\": \"London\",\n \"zipcode\": \"WC1E 7BT\"\n },\n \"contact\": {\n \"website\": \"https://www.woosmap.com\",\n \"phone\": \"+44 20 7693 4000\",\n \"email\": \"[email protected]\"\n },\n \"userProperties\": {\n \"some_user_properties\": \"associated user value\"\n },\n \"openingHours\": {\n \"timezone\": \"Europe/London\",\n \"usual\": {\n \"1\": [],\n \"default\": [\n {\n \"start\": \"08:30\",\n \"end\": \"22:00\"\n }\n ]\n },\n \"special\": {\n \"2015-02-07\": [\n {\n \"start\": \"08:00\",\n \"end\": \"23:00\"\n }\n ]\n }\n }\n },\n {\n \"types\": [\n \"drive\"\n ],\n \"tags\": [\n \"covered_parking\"\n ],\n \"location\": {\n \"lat\": 38.5239,\n \"lng\": -77.0157\n },\n \"storeId\": \"STORE_ID_45678\",\n \"name\": \"My Cool Store 2\",\n \"address\": {\n \"lines\": [\n \"1805-1899\",\n \"Orchard St\"\n ],\n \"countryCode\": \"US\",\n \"city\": \"Alexandria\",\n \"zipcode\": \"22309\"\n },\n \"contact\": {\n \"website\": \"https://www.woosmap.com\",\n \"phone\": \"+44 20 7693 4000\",\n \"email\": \"[email protected]\"\n },\n \"userProperties\": {\n \"some_user_properties\": \"associated user value\"\n },\n \"openingHours\": {\n \"timezone\": \"America/New_York\",\n \"usual\": {\n \"1\": [],\n \"default\": [\n {\n \"start\": \"08:30\",\n \"end\": \"22:00\"\n }\n ]\n }\n }\n }\n ]\n}");
Request request = new Request.Builder()
.url("https://api.woosmap.com/stores?private_key=YOUR_PRIVATE_API_KEY")
.method("POST", body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
require "uri"
require "json"
require "net/http"
url = URI("https://api.woosmap.com/stores?private_key=YOUR_PRIVATE_API_KEY")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = "application/json"
request.body = JSON.dump({
"stores": [
{
"types": [
"drive",
"click_and_collect"
],
"tags": [
"wifi",
"covered_parking"
],
"location": {
"lat": 38.719,
"lng": -77.1067
},
"storeId": "STORE_ID_123456",
"name": "My Cool Store",
"address": {
"lines": [
"Building Centre",
"26 Store Street"
],
"countryCode": "UK",
"city": "London",
"zipcode": "WC1E 7BT"
},
"contact": {
"website": "https://www.woosmap.com",
"phone": "+44 20 7693 4000",
"email": "[email protected]"
},
"userProperties": {
"some_user_properties": "associated user value"
},
"openingHours": {
"timezone": "Europe/London",
"usual": {
"1": [],
"default": [
{
"start": "08:30",
"end": "22:00"
}
]
},
"special": {
"2015-02-07": [
{
"start": "08:00",
"end": "23:00"
}
]
}
}
},
{
"types": [
"drive"
],
"tags": [
"covered_parking"
],
"location": {
"lat": 38.5239,
"lng": -77.0157
},
"storeId": "STORE_ID_45678",
"name": "My Cool Store 2",
"address": {
"lines": [
"1805-1899",
"Orchard St"
],
"countryCode": "US",
"city": "Alexandria",
"zipcode": "22309"
},
"contact": {
"website": "https://www.woosmap.com",
"phone": "+44 20 7693 4000",
"email": "[email protected]"
},
"userProperties": {
"some_user_properties": "associated user value"
},
"openingHours": {
"timezone": "America/New_York",
"usual": {
"1": [],
"default": [
{
"start": "08:30",
"end": "22:00"
}
]
}
}
}
]
})
response = https.request(request)
puts response.read_body
Was this article helpful?
Have more questions? Submit a request