Create an Account for the authenticated User if an Account for that User does not already exist. Each User can only have one Account.
URL : /api/Home/{groceryListId}
Method : GET
Auth required : NO
Permissions required : None
Data constraints
{
"name": "[unicode 64 chars max]"
}
Condition : If everything is OK and an Account didn't exist for this User.
Code : 201 CREATED
Content example
{
"id": 123,
"name": "Build something project dot com",
"url": "http://testserver/api/accounts/123/"
}
Condition : If Account already exists for User.
Code : 303 SEE OTHER
Headers : Location: http://testserver/api/accounts/123/
Content : {}
Condition : If fields are missed.
Code : 400 BAD REQUEST
Content example
{
"name": [
"This field is required."
]
}
Get items for the house
-
URL
/api/Hom/{List id}
-
Method:
GET
-
URL Params
<If URL params exist, specify them in accordance with name mentioned in URL section. Separate into optional and required. Document data constraints.>
Required:
id=[integer]
Optional:
photo_id=[alphanumeric]
-
Data Params
<If making a post request, what should the body payload look like? URL Params rules apply here too.>
-
Success Response:
<What should the status code be on success and is there any returned data? This is useful when people need to to know what their callbacks should expect!>
- Code: 200
Content:{ id : 12 }
- Code: 200
-
Error Response:
<Most endpoints will have many ways they can fail. From unauthorized access, to wrongful parameters etc. All of those should be liste d here. It might seem repetitive, but it helps prevent assumptions from being made where they should be.>
- Code: 401 UNAUTHORIZED
Content:{ error : "Log in" }
OR
- Code: 422 UNPROCESSABLE ENTRY
Content:{ error : "Email Invalid" }
- Code: 401 UNAUTHORIZED
-
Sample Call:
<Just a sample call to your endpoint in a runnable format ($.ajax call or a curl request) - this makes life easier and more predictable.>
-
Notes:
<This is where all uncertainties, commentary, discussion etc. can go. I recommend timestamping and identifying oneself when leaving comments here.>
-
URL
-
Method:
<The request type>
GET
|POST
|DELETE
|PUT
-
URL Params
<If URL params exist, specify them in accordance with name mentioned in URL section. Separate into optional and required. Document data constraints.>
Required:
id=[integer]
Optional:
photo_id=[alphanumeric]
-
Data Params
<If making a post request, what should the body payload look like? URL Params rules apply here too.>
-
Success Response:
<What should the status code be on success and is there any returned data? This is useful when people need to to know what their callbacks should expect!>
- Code: 200
Content:{ id : 12 }
- Code: 200
-
Error Response:
<Most endpoints will have many ways they can fail. From unauthorized access, to wrongful parameters etc. All of those should be liste d here. It might seem repetitive, but it helps prevent assumptions from being made where they should be.>
- Code: 401 UNAUTHORIZED
Content:{ error : "Log in" }
OR
- Code: 422 UNPROCESSABLE ENTRY
Content:{ error : "Email Invalid" }
- Code: 401 UNAUTHORIZED
-
Sample Call:
<Just a sample call to your endpoint in a runnable format ($.ajax call or a curl request) - this makes life easier and more predictable.>
-
Notes:
<This is where all uncertainties, commentary, discussion etc. can go. I recommend timestamping and identifying oneself when leaving comments here.>
-
Method:
<The request type>
GET
|POST
|DELETE
|PUT
-
URL Params
<If URL params exist, specify them in accordance with name mentioned in URL section. Separate into optional and required. Document data constraints.>
Required:
id=[integer]
Optional:
photo_id=[alphanumeric]
-
Data Params
<If making a post request, what should the body payload look like? URL Params rules apply here too.>
-
Success Response:
<What should the status code be on success and is there any returned data? This is useful when people need to to know what their callbacks should expect!>
- Code: 200
Content:{ id : 12 }
- Code: 200
-
Error Response:
<Most endpoints will have many ways they can fail. From unauthorized access, to wrongful parameters etc. All of those should be liste d here. It might seem repetitive, but it helps prevent assumptions from being made where they should be.>
- Code: 401 UNAUTHORIZED
Content:{ error : "Log in" }
OR
- Code: 422 UNPROCESSABLE ENTRY
Content:{ error : "Email Invalid" }
- Code: 401 UNAUTHORIZED
-
Sample Call:
<Just a sample call to your endpoint in a runnable format ($.ajax call or a curl request) - this makes life easier and more predictable.>
-
Notes:
<This is where all uncertainties, commentary, discussion etc. can go. I recommend timestamping and identifying oneself when leaving comments here.>