Custom Links API

Creating Custom Links

POST /api/v1/custom_links

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

Route

POST /api/v1/custom_links

Body

{"id":2,"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" -d '{"id":2,"open_in_new_tab":false,"visible_to":"all","text":"Header Link","url":"www.google.com","location":"header","position":1}' -X POST \
	-H "Accept: application/json" \
	-H "X-Api-Token: N2E7CJ64KrEosndJRjT2c85WrxRLzEZBAQ" \
	-H "X-Api-Email: user-151@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

201 Created

Body

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