Replace all assets
POST
https://api.woosmap.com/stores/replace
To replace all your Assets. This endpoint will delete all previous assets and import assets in request body. During the operation previous assets could always be displayed on map. If the import failed previous assets are not deleted.
Authorization
private_key
apiKey query
Request Body
The request body of Stores Replace must be formatted as JSON.
stores
object[] required
Show 10 propertiesHide 10 properties
Show 4 propertiesHide 4 properties
Show 3 propertiesHide 3 properties
Show 8 propertiesHide 8 properties
Show 2 propertiesHide 2 properties
Example
Stores Data to replace as JSON
{
"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
Assets successfully replaced
curl -L 'https://api.woosmap.com/stores/replace?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"
}
]
}
}
}
]
}'
import requests
import json
url = "https://api.woosmap.com/stores/replace?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)
const axios = require('axios');
let 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"
}
]
}
}
}
]
});
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://api.woosmap.com/stores/replace?private_key=YOUR_PRIVATE_API_KEY',
headers: {
'content-type': 'application/json'
},
data : data
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
{
"status": "success",
"value": "2 stores deleted, 2 stores created"
}
{
"status": "error",
"value": "The request is invalid, the data is not a valid JSON."
}
{
"detail": "Incorrect authentication credentials. Please check or use a valid API Key"
}
{
"detail": "This Woosmap API is not enabled for this project."
}