Addresses API

PUT - /api/v1/addresses/:id - Updating

PUT /api/v1/addresses/:id

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: xzfxZzpENqcnsif2B5axHLx45HyFQsVJsw
X-Api-Email: user-373@example.com

Route

PUT /api/v1/addresses/2

Body

{"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/2" -d '{"line_one":"158 powers","line_two":"#1","postal_code":"11211","country":"US","region":"NY","phone_number":"5555555555","city":"New York"}' -X PUT \
	-H "Accept: application/json" \
	-H "X-Api-Token: xzfxZzpENqcnsif2B5axHLx45HyFQsVJsw" \
	-H "X-Api-Email: user-373@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

202 Accepted

Body

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