Addresses API

Creating Addresses

POST /api/v1/addresses

Parameters

Name Description
id id
line_one Address line one
line_two Address line two
postal_code Zip code/postal code
country Country
region Region/state
phone_number Telephone Number
city City

Request

Headers

Accept: application/json
X-Api-Token: RFsMfDnBi4fnsVGREHSeT8qsVGJMxR-2DA
X-Api-Email: user-379@example.com

Route

POST /api/v1/addresses

Body

{"id":5,"line_one":"158 powers","line_two":"#1","postal_code":"11211","country":"US","region":"NY","phone_number":"5555555555","city":"New York"}

cURL

curl "http://localhost:3000/api/v1/addresses" -d '{"id":5,"line_one":"158 powers","line_two":"#1","postal_code":"11211","country":"US","region":"NY","phone_number":"5555555555","city":"New York"}' -X POST \
	-H "Accept: application/json" \
	-H "X-Api-Token: RFsMfDnBi4fnsVGREHSeT8qsVGJMxR-2DA" \
	-H "X-Api-Email: user-379@example.com" \
	-H "Content-Type: application/json" \
	-H "Host: school.worksonmy.computer"

Response

Headers

Content-Type: application/json; charset=utf-8
Content-Length: 264

Status

201 Created

Body

{
  "created_at": "2019-10-31T22:10:40Z",
  "line_one": "158 powers",
  "line_two": "#1",
  "postal_code": "11211",
  "country": "US",
  "region": "NY",
  "phone_number": "5555555555",
  "id": 6,
  "city": "New York",
  "meta": {
    "class": "address",
    "url": null,
    "name": "6",
    "description": "",
    "image_url": null
  }
}