Networks¶
Network users are replicated to and retrieved from the Invoca Marketing Automation Platform using this API.
The network interface is fully idempotent, and the create and update commands both expect the full set of users each time. For instance, if on one POST two users, user1@invoca.com and user2@invoca.com are specified, but on the next POST, only user1@invoca.com is specified, then as a result of that second post, user2@invoca.com will be deleted. For this reason, POST and PUT requests are identical in their effect, although they return 201 and 200 codes respectively for ease of integration.
Parameters
Property |
Type |
Value |
---|---|---|
name |
string |
Network name (read only). |
users |
json array of hashes |
0 or more users for the network. User attributes are listed below. |
id_from_network |
string |
The network’s id for this User. |
email_address |
string in RFC 2822 addr_spec format |
The user’s email address. Unique for this user. (mandatory field) |
first_name |
string |
The user’s first name. |
last_name |
string |
The user’s last name. |
phone_number |
string in ITU E.164 format or 10-digit US form (no punctuation) |
The user’s phone number. |
role |
One of: Super (default), Manager, Member, Observer, Reporting |
The user’s role within the network. |
Endpoint:
https://invoca.net/api/2016-05-01/<network_id>/network.json
Examples
Read network and its users
Endpoint:
https://invoca.net/api/2016-05-01/<network_id>/network.json
Format: application/json
Response Code: 200
Response Body:
{
"name": "Invoca",
"users": [
{
"id_from_network": "549494858585cFUyYnFHyiYA42TrpM",
"email_address": "[email protected]",
"first_name": "Chris",
"last_name": "Dean",
"phone_number": "800‐437‐7950",
"role": "Manager"
},
{
"id_from_network": "694940505055cFUyYnFHyiYA42TrpM",
"email_address": "[email protected]",
"first_name": "Jim",
"last_name": "Williams",
"phone_number": "800‐437‐7950",
"role": "Observer"
}
]
}
Examples
Create network users
Endpoint:
https://invoca.net/api/2016-05-01/<network_id>/network.json
Format: application/json
Request Body:
{
"users": [
{
"id_from_network": "549494858585cFUyYnFHyiYA42TrpM",
"email_address": "[email protected]",
"first_name": "Chris",
"last_name": "Dean",
"phone_number": "8004377950",
"role": "Manager"
},
{
"id_from_network": "694940505055cFUyYnFHyiYA42TrpM",
"email_address": "[email protected]",
"first_name": "Jim",
"last_name": "Williams",
"phone_number": "8004377950",
"role": "Observer"
}
]
}
Response Code: 201
Examples
Update a network and its user with invalid email address
Endpoint:
https://invoca.net/api/2016-05-01/<network_id>/network.json
Format: application/json
Request Body:
{
"users": [
{
"id_from_network": "549494858585cFUyYnFHyiYA42TrpM",
"email_address": "chris@",
"first_name": "Chris",
"last_name": "Dean",
"phone_number": "8004377950",
"role": "Manager"
}
]
}
Response Code: 403
Response Body:
{
"errors": {
"users": [
{
"email_address": [
"is invalid"
]
}
]
}
}
Delete network users by putting an empty user hash
Endpoint:
https://invoca.net/api/2016-05-01/<network_id>/network.json
Format: application/json
Request Body:
{
"users": [
]
}