Add Point
With this endpoint you can create a new Point
URL¶
POST https://api.geposit.se/1.1/add/point
Mandatory header parameters¶
x-api-key
(String) This is your API-key and should be included in the header.
Mandatory POST parameters¶
-
name
(String) Name of the Point -
country_code
(String) Country code of the point. Supported values arese
,no
,dk
andfi
Optional POST parameters¶
style
(Array) Array of styles which can be used to style the point.
Supported Colors | Supported icons |
---|---|
111111 | fa-map-marker |
85144b | fa-map-pin |
004a96 | fa-home |
00545e | fa-thumb-tack |
7011fb | fa-building |
80420d | fa-heart |
b10dc9 | fa-user |
f41f1f | fa-shopping-cart |
f012be | fa-info-circle |
646464 | |
d06100 | |
0081f2 | |
4d9b22 | |
ff6666 | |
ff8214 | |
3da57a | |
009eaf | |
ff76e0 | |
89ac4e | |
98ee06 | |
ffdc00 | |
33c5c5 | |
d1b9ec | |
8ccaff | |
a6a6a6 |
-
style[color] = 8ccaff
Sets the point color to8ccaff
. -
style[icon] = fa-info-circle
Sets the point icon tofa-info-circle
.
If no style attribute supplied when creating a point, the color will be set to 111111
and icon will be set to fa-map-marker
.
address
(Array) Array of address details of the points. Supported values are
Attribute | Description | Example |
---|---|---|
address[street] | address of the point | Stabbarpsvägen |
address[street_number] | street number of the point | 5 |
address[extra_number] | extra number, if any | 1 |
address[letter] | letter, if any | A |
address[postalcode] | postalcode of the point | 24133 |
address[locality] | locality of the point | Eslöv |
address[type] | address type | NB |
address[country_code] | country code of the address | se |
address[extra] | any extra attributes | se |
-
x_lon
(Double) Longitude of the Point -
y_lat
(Double) Latitude of the Point -
location_origin
(String) This attribute can be used to define the origin of the point. supported values areaddress
,manual
,none
If no location origin given when creating the point, it will be set to none
Example Request¶
curl -X POST -H "X-api-key: {API_KEY}" https://api-acc.geposit.se/1.1/add/point -d "country_code=se&name=allan&address[locality]=Arboga&address[street]=Schelinska gatan&address[street_number]=6&address[postalcode]=73232&style[color]=98ee06”
client()->post("add/point", [
"query" => [
"name" => "My point 01",
"country_code" => "se",
"style" => ["color" => "8ccaff", "icon" => "fa-building"]
],
"headers" => [
"x-api-key" => "your-api-key"
],
]);
Response¶
The response will be in JSON format. Every response comes with a status flag (Integer) where:
status = 0
- Request had bad parameter input / generic error.status = 1
- Request was successful
Valid response¶
{
"point_id": 4101002,
"country_code": "se",
"name": "my point 31",
"active": 1,
"visible": 1,
"date_created": "2021-06-01 06:56:08",
"date_modified": "2021-06-01 06:56:08",
"style": {
"color": "111111",
"icon": "fa-map-marker"
},
"address_status": 0,
"address": {
"country_code": "se",
"address_type": null,
"street": null,
"street_number": null,
"extra_number": null,
"letter": null,
"extra": null,
"postalcode": null,
"locality": null
},
"location_origin": "none",
"location_status": 1,
"location": {
"x_lon": 13.430519446879,
"y_lat": 58.385524063997
},
"tags": [],
"custom_fields": [],
"status": 1
}
Invalid response¶
Invalid use of supported parameters
{
"error": "Mandatory parameter country_code missing",
"status": 0
}
{
"status": 0,
"error": "Generic error"
}