[ ! ] THE DOCUMENTATION BELOW IS DEPRECATED [ ! ]
[ ! ] YOU CAN FIND THE UPDATED ONE HERE [ ! ]
https://api-user-forms.herokuapp.com/v1/users/
https://api-user-forms.herokuapp.com/v1/users/<id>
https://api-user-forms.herokuapp.com/v1/forms/
https://api-user-forms.herokuapp.com/v1/forms/<id>
POST https://api-user-forms.herokuapp.com/v1/users/
//json request
{
"name": " enter name here ", // required - string
"password": " enter password here ", // required - string
"email": " email@example.com ", // required - string
"address": " enter address here ", // required - string
"fiscal_code": " defaults to 0 " // optional - number
}
GET https://api-user-forms.herokuapp.com/v1/users/
- empty list example:
// json response
[]
- users in list example:
//json response
[
{
"_id": "6404692ed2cc374748b0fb23",
"name": "Stefan",
"password": "mypass12",
"email": "stefan@yahoo.com",
"address": "personal address",
"fiscal_code": 0,
"__v": 0
},
{
"_id": "64046940d2cc374748b0fb27",
"name": "Mihai",
"password": "cookie",
"email": "mihai@yahoo.com",
"address": "personal address 2",
"fiscal_code": 0,
"__v": 0
},
{
"_id": "64046952d2cc374748b0fb29",
"name": "Andreea",
"password": "flower pot",
"email": "andreea@gmail.com",
"address": "personal address 3",
"fiscal_code": 0,
"__v": 0
}
]
GET https://api-user-forms.herokuapp.com/v1/users/<id>
- example
GET https://api-user-forms.herokuapp.com/v1/users/64046952d2cc374748b0fb29
returns:
//json response
{
"_id": "64046952d2cc374748b0fb29",
"name": "Andreea",
"password": "flower pot",
"email": "andreea@gmail.com",
"address": "personal address 3",
"fiscal_code": 0,
"__v": 0
}
PATCH https://api-user-forms.herokuapp.com/v1/users/<id>
- example
PATCH https://api-user-forms.herokuapp.com/v1/users/64046952d2cc374748b0fb29
:
//json request
{
"password": "new flower pot",
"email": "newmail@gmail.com"
}
GET https://api-user-forms.herokuapp.com/v1/users/64046952d2cc374748b0fb29
:
//json response
{
"_id": "64046952d2cc374748b0fb29",
"name": "Andreea",
"password": "new flower pot", // changed
"email": "newmail@gmail.com", // changed
"address": "personal address 3",
"fiscal_code": 0,
"__v": 0
}
DELETE https://api-user-forms.herokuapp.com/v1/users/<id>
- example
DELETE https://api-user-forms.herokuapp.com/v1/users/64046940d2cc374748b0fb27
:
GET https://api-user-forms.herokuapp.com/v1/users/
will return this now:
//json response
[
{
"_id": "6404692ed2cc374748b0fb23",
"name": "Stefan",
"password": "mypass12",
"email": "stefan@yahoo.com",
"address": "personal address",
"fiscal_code": 0,
"__v": 0
}, // Second user Mihai was removed
{
"_id": "64046952d2cc374748b0fb29",
"name": "Andreea",
"password": "flower pot",
"email": "andreea@gmail.com",
"address": "personal address 3",
"fiscal_code": 0,
"__v": 0
}
]
POST https://api-user-forms.herokuapp.com/v1/forms/
//json request
{
"title": " enter title here ", // required - string
"retention_date": " enter retention date here ", // required - date
"dynamic_fields": [ // LIST
{
"dynamic_field_name": " enter field name here ", // required - string
"label": " enter label name here ", // required - string
"placeholder": " enter placeholder here ", // required - string
"mandatory": true, // required - boolean
"keywords": [ // LIST
" enter key here " // required - string
],
"field_type": {
"name": " enter name here ", // required - string
"options": [ // LIST
" enter option name here " // required - string
]
}
}
]
}
GET https://api-user-forms.herokuapp.com/v1/forms/
- empty list example:
// json response
[]
- forms in list example:
//json response
[
{ // form start
"_id": "6411da8bcfe3dbcddf3c8b20",
"title": "Test Form",
"retention_date": "2023-03-10T00:00:00.000Z",
"dynamic_fields": [
{
"dynamic_field_name": "First Field",
"label": "Label",
"placeholder": "Placeholder",
"mandatory": true,
"keywords": [
"Key 1",
"Key 2",
"Key 3"
],
"field_type": [
{
"_id": "6411dfec11625e1776b1bb88",
"name": "Field Type name",
"options": [
"Option 1",
"Option 2"
]
}
],
"_id": "6411da8bcfe3dbcddf3c8b21"
}
],
"__v": 0
} // form end
// , { NEXT FORM }, { NEXT FORM }
]
GET https://api-user-forms.herokuapp.com/v1/forms/<id>
- example
GET https://api-user-forms.herokuapp.com/v1/forms/6411da8bcfe3dbcddf3c8b20
returns:
//json response
{
"_id": "6411da8bcfe3dbcddf3c8b20",
"title": "Formular de test",
"retention_date": "2023-03-10T00:00:00.000Z",
"dynamic_fields": [
{
"dynamic_field_name": "Primul Camp",
"label": "Eticheta Camp",
"placeholder": "Introdu date",
"mandatory": true,
"keywords": [
"cheie 1",
"cheie 2",
"cheie 3"
],
"field_type": [
{
"_id": "6411e0de11625e1776b1bb8b",
"name": "nume tip camp",
"options": [
"nume optiune 1",
"nume optiune 2"
]
}
],
"_id": "6411da8bcfe3dbcddf3c8b21"
}
],
"__v": 0
}
PATCH https://api-user-forms.herokuapp.com/v1/forms/<id>
- example
PATCH https://api-user-forms.herokuapp.com/v1/forms/6411da8bcfe3dbcddf3c8b20
:
//json request
{
"title": "new form title"
}
GET https://api-user-forms.herokuapp.com/v1/users/6411da8bcfe3dbcddf3c8b20
:
//json response
{
"_id": "6411da8bcfe3dbcddf3c8b20",
"title": "new form title",
"retention_date": "2023-03-10T00:00:00.000Z",
"dynamic_fields": [
{
"dynamic_field_name": "Primul Camp",
"label": "Eticheta Camp",
"placeholder": "Introdu date",
"mandatory": true,
"keywords": [
"cheie 1",
"cheie 2",
"cheie 3"
],
"field_type": [
{
"_id": "6411e0de11625e1776b1bb8b",
"name": "nume tip camp",
"options": [
"nume optiune 1",
"nume optiune 2"
]
}
],
"_id": "6411da8bcfe3dbcddf3c8b21"
}
],
"__v": 0
}
DELETE https://api-user-forms.herokuapp.com/v1/forms/<id>
- example
DELETE https://api-user-forms.herokuapp.com/v1/forms/6411da8bcfe3dbcddf3c8b20
:
[ ! ] THE DOCUMENTATION BELOW IS DEPRECATED [ ! ]
[ ! ] YOU CAN FIND THE UPDATED ONE HERE [ ! ]