POST
https://ushahididocs.api.ushahidi.io/api/v3/contacts
user_id
Integer
The user identifier
country_code
String
Country code
can_notify
Boolean
Set True to enable contact notification and False to disable
contact
String
Contact number
type
String
The type of contact e.g. "phone"
data_source
String
The data source
{
"id": 1,
"url": "http://localhost:8000/api/v3/contacts/1",
"user": {
"id": 1,
"url": "http://localhost:8000/api/v3/users/1"
},
"data_source": null,
"type": "phone",
"contact": "123456789",
"created": "1970-01-01T00:00:00+00:00",
"updated": null,
"can_notify": false,
"country_code": null,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
PUT
https://ushahididocs.api.ushahidi.io/api/v3/contacts/3
user_id
Integer
The user identifier
country_code
String
Country code
can_notify
Boolean
Set True to enable contact notification and False to disable
contact
String
Contact number
type
String
The type of contact e.g. "phone"
data_source
String
The data source
{
"id": 1,
"url": "http://localhost:8000/api/v3/contacts/1",
"user": {
"id": 1,
"url": "http://localhost:8000/api/v3/users/1"
},
"data_source": null,
"type": "phone",
"contact": "123456789",
"created": "1970-01-01T00:00:00+00:00",
"updated": null,
"can_notify": false,
"country_code": null,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
Sorting parameter Available values : entity fields Default value : id
failed_attempts
Sorting parameter Available values : [ASC,DESC] Default value : ASC
Desc
Paging parameter Default value : null
2
Paging parameter Default value : 0
3
Filter Parameter check the contact
123456789
Filter Parameter check the type Available values : [email,phone,email]
email
Filter Parameter check the user_id
1
Filter Parameter check the data_source
email
GET /api/v3/contacts HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"count": 9,
"results": [
{
"id": 1,
"url": "http://localhost:8000/api/v3/contacts/1",
"user": {
"id": 1,
"url": "http://localhost:8000/api/v3/users/1"
},
"type": "phone",
"contact": "123456789",
"created": "1970-01-01T00:00:00+00:00",
"can_notify": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
},
{
"id": 2,
"url": "http://localhost:8000/api/v3/contacts/2",
"type": "email",
"contact": "somejunkemail@v3.ushahidi.com",
"created": "1970-01-01T00:00:00+00:00",
"can_notify": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
},
{
"id": 3,
"url": "http://localhost:8000/api/v3/contacts/3",
"user": {
"id": 1,
"url": "http://localhost:8000/api/v3/users/1"
},
"type": "phone",
"contact": "123456789",
"created": "1970-01-01T00:00:00+00:00",
"updated": "2022-11-02T15:35:51+00:00",
"can_notify": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
},
{
"id": 4,
"url": "http://localhost:8000/api/v3/contacts/4",
"user": {
"id": 1,
"url": "http://localhost:8000/api/v3/users/1"
},
"type": "email",
"contact": "robbie@ushahidi.com",
"created": "1970-01-01T00:00:00+00:00",
"can_notify": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
},
{
"id": 5,
"url": "http://localhost:8000/api/v3/contacts/5",
"type": "phone",
"contact": "099999999",
"created": "1970-01-01T00:00:00+00:00",
"can_notify": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
},
{
"id": 6,
"url": "http://localhost:8000/api/v3/contacts/6",
"type": "phone",
"contact": "99999991",
"created": "1970-01-01T00:00:00+00:00",
"can_notify": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
},
{
"id": 7,
"url": "http://localhost:8000/api/v3/contacts/7",
"type": "phone",
"contact": "99999992",
"created": "1970-01-01T00:00:00+00:00",
"can_notify": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
},
{
"id": 8,
"url": "http://localhost:8000/api/v3/contacts/8",
"type": "phone",
"contact": "59891333224",
"created": "1970-01-01T00:00:00+00:00",
"can_notify": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
},
{
"id": 9,
"url": "http://localhost:8000/api/v3/contacts/9",
"type": "phone",
"contact": "59891333225",
"created": "1970-01-01T00:00:00+00:00",
"can_notify": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
],
"offset": 0,
"order": "asc",
"orderby": "id",
"curr": "http://localhost:8000/api/v3/contacts?orderby=id&order=asc&offset=0",
"next": "http://localhost:8000/api/v3/contacts?orderby=id&order=asc&offset=0",
"prev": "http://localhost:8000/api/v3/contacts?orderby=id&order=asc&offset=0",
"total_count": 9
}
GET /api/v3/contacts/1 HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"id": 1,
"url": "http://localhost:8000/api/v3/contacts/1",
"user": {
"id": 1,
"url": "http://localhost:8000/api/v3/users/1"
},
"type": "phone",
"contact": "123456789",
"created": "1970-01-01T00:00:00+00:00",
"can_notify": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}
DELETE /api/v3/contacts/9 HTTP/1.1
Host: ushahididocs.api.ushahidi.io
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"id": 10,
"url": "http://localhost:8000/api/v3/contacts/10",
"type": "phone",
"contact": "59891333226",
"created": "1970-01-01T00:00:00+00:00",
"can_notify": false,
"allowed_privileges": [
"read",
"create",
"update",
"delete",
"search"
]
}