Get all lists
Code Block |
---|
|
curl 'http://api.linkmobility.dk/v2/lists.json?apikey=[apikey]' -X GET
curl 'http://api.linkmobility.dk/v2/lists.xml?apikey=[apikey]' -X GET
|
...
Code Block |
---|
|
{
"list": [
{
"id": "1",
"parent": "0",
"name": "HMN"
},
{
"id": "9",
"parent": "0",
"name": "test42"
}
],
"status": 200
}
|
Get specific list and all the contacts in it
...
Code Block |
---|
|
{
"list": {
"id": "33",
"parent": "9",
"name": "Underliste 2",
"contacts": [
{
"id": "85",
"listid": "9",
"mobile": "+4587654321",
"created": "2014-12-15 13:51:26",
"changed": "2014-12-15 13:51:26",
"fields": {
"Fornavn": "Jack",
"Efternavn": "Bauer"
}
},
{
"id": "93",
"listid": "9",
"mobile": "+4512345678",
"created": "2014-12-15 13:52:32",
"changed": "2014-12-15 13:52:32",
"fields": {
"Fornavn": "Anders",
"Efternavn": "And"
}
}
]
},
"status": 200
}
|
POST /list.{format}
Create new list
Code Block |
---|
|
curl 'http://api.linkmobility.dk/v2/list.json?apikey=[apikey]' -X POST -H "Content-Type: application/json" -d @file.json
curl 'http://api.linkmobility.dk/v2/list.xml?apikey=[apikey]' -X POST -H "Content-Type: text/xml" -d @file.xml
|
payload
file.json
Code Block |
---|
|
{
"list":{
"parent": 0,
"name":"test123"
}
}
|
...
Code Block |
---|
|
<?xml version="1.0" encoding="UTF-8"?>
<list>
<parent>0</parent>
<name>test42</name>
</list>
|
response
Code Block |
---|
|
{
"list": {
"id": "61",
"parent": "0",
"name": "test123",
"contacts": []
},
"status": 201
}
|
...
Code Block |
---|
|
<?xml version="1.0"?>
<response>
<list>
<id>69</id>
<parent>0</parent>
<name>test42</name>
<contacts/>
</list>
<status>201</status>
</response>
|
Update existing list
Code Block |
---|
|
curl 'http://api.linkmobility.dk/v2/list/{id}.json?apikey=[apikey]' -X PUT -H "Content-Type: application/json" -d @file.json
curl 'http://api.linkmobility.dk/v2/list/{id}.xml?apikey=[apikey]' -X PUT -H "Content-Type: text/xml" -d @file.xml
|
payload
file.json
Code Block |
---|
|
{
"list":{
"parent": 0,
"name":"test123"
}
}
|
...
Code Block |
---|
|
<?xml version="1.0" encoding="UTF-8"?>
<list>
<parent>0</parent>
<name>test42</name>
</list>
|
response
Code Block |
---|
|
{
"list": {
"id": "61",
"parent": "0",
"name": "test123",
"contacts": []
},
"status": 201
}
|
...
Code Block |
---|
|
<?xml version="1.0"?>
<response>
<list>
<id>69</id>
<parent>0</parent>
<name>test42</name>
<contacts/>
</list>
<status>201</status>
</response>
|
Delete a specific list
Code Block |
---|
|
curl 'http://api.linkmobility.dk/v2/list/{id}.json?apikey=[apikey]' -X DELETE
curl 'http://api.linkmobility.dk/v2/list/{id}.xml?apikey=[apikey]' -X DELETE
|
...