Custom Links API

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

PUT /api/v1/custom_links/:id

Parameters

Name Description
id id
open_in_new_tab boolean
visible_to all, logged_in, logged_out
text link text
url link target
location loc
position position

Request

Headers

Accept: application/json
X-Api-Token: cqprzhgcdF8YE_Pc8upmJew1gQ-EZL1LzA
X-Api-Email: user-155@example.com

Route

PUT /api/v1/custom_links/5

Body

{"open_in_new_tab":false,"visible_to":"all","text":"Header Link","url":"www.google.com","location":"header","position":1}

cURL

curl "http://localhost:3000/api/v1/custom_links/5" -d '{"open_in_new_tab":false,"visible_to":"all","text":"Header Link","url":"www.google.com","location":"header","position":1}' -X PUT \
	-H "Accept: application/json" \
	-H "X-Api-Token: cqprzhgcdF8YE_Pc8upmJew1gQ-EZL1LzA" \
	-H "X-Api-Email: user-155@example.com" \
	-H "Content-Type: application/json" \
	-H "Host: school.worksonmy.computer"

Response

Headers

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

Status

202 Accepted

Body

{
  "created_at": "2019-10-31T21:59:38Z",
  "target": "",
  "position": 1,
  "visible_to": "all",
  "open_in_new_tab": false,
  "location": "header",
  "text": "Header Link",
  "url": "www.google.com",
  "id": 5,
  "meta": {
    "class": "customlink",
    "url": "/api/v1/custom_links/5",
    "name": "5",
    "description": "",
    "image_url": null
  }
}