#API Object: marketplace.contactType
##Definition
Use the /contactType API to create, update, read or delete a contact type or list of contact types in the system.
##Resource Information The following properties appear in the Contact Type JSON:
| Parameter | Description |
| id | The numerical ID associated with the contact type object. |
| required | A true or false field that validates if the contact type must be included to pass in a listing for approval. |
| title | The name of the contact type. |
##Request URL
https://localhost:8443/marketplace/api/contactType
This placeholder URL will vary depending upon your deployment. Be mindful that https://localhost:8443/marketplace is an example "base/context/domain" where your WAR is deployed.
##Request Methods
POST,
PUT,
GET,
DELETE
Each method will be explained in the following sections:
###POST Use this call to create a contact type in the system.
#####Request
https://localhost:8443/marketplace/api/contactType
{
"title":"Technical Contact",
"required":false
}
#####Response Code: 201
#####Response
{
"id":5,
"required":false,
"title":"Technical Contact",
"_links":{
"self":{
"href":"https://localhost:8443/marketplace/api/contactType/5"
}
}
}
#####Requirements
none
###PUT###
Use this call to update a contact type in the system.
#####Request
https://localhost:8443/marketplace/api/contactType/{id}
{
"id":12,
"title":"Title",
"required":false
}
#####Response Code: 200
#####Response
{
"id":12,
"required":false,
"title":"Title",
"_links":{
"self":{
"href":"https://localhost:8443/marketplace/api/contactType/12"
}
}
}
#####Requirements
none
###GET###
Use this call to read or view a contact type or all the contact types in the system.
#####Request
If you want to see a list of all the contact types in the system, enter:
https://localhost:8443/marketplace/api/contactType/
However, to view metadata about only one contact type, enter:
https://localhost:8443/marketplace/api/contactType/{id}
Marketplace returns the representation of the contact type that matches the{id}, as shown in the Response for one contact type id.
#####Response Code: 200
#####Response for one contact type id
{
"id":30,
"required":true,
"title":"ContactType_8",
"_links":{
"self":{
"href":"https://localhost:8443/marketplace/api/contactType/30"
}
}
}
#####Requirements
none
#####Optional Parameters
If you want to limit the responses, for example, only return 5, use Optional Parameters which are included in the code as @QueryParam:
offset--an integer offset
Example: https://localhost:8443/marketplace/api/contactType?offset=5
max--maximum number of contact type ids your call will return
Example: https://localhost:8443/marketplace/api/contactType?max=5
###DELETE###
Use this call to remove a contact type from the system.
#####Requirements
https://localhost:8443/marketplace/api/contactType/{id}
#####Response Code: 204
#####Response
no content
#####Requirements none
###Possible Errors
This table lists common errors. Other errors may occur but these are the most likely:
| Error Code |
Error | Troubleshooting |
| 403 | User cannot create, edit, delete a contact type. | Only administrators can create, edit, delete contact types. |
| 400 | Contact types cannot be created or updated. | The contact type must include all required fields. |
| 400 | Contact type must have a unique name. | If the contact type name is not unique, a validation error occurs when you try to save. |