LinkCheckerResource Resource

Resource for the link checker

POST /linkChecker/check

Check an external link for validity

Request Body
media type data type description
application/json CheckExternalLinkRequest (JSON) request containing the link to check
Response Codes
code condition
200 Check result is returned.
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions.
405 The feature link_checker is not activated.
Response Body
media type data type description
application/json CheckResponse (JSON) check response

Example

Request
POST /linkChecker/check
Content-Type: application/json
Accept: application/json

                
{
  "url" : "..."
}
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "valid" : true,
  "reason" : "...",
  "messages" : [ { }, { } ],
  "responseInfo" : {
    "responseCode" : "OK",
    "responseMessage" : "...",
    "property" : "..."
  }
}
                
              

GET /linkChecker/pages

Get list of pages containing external links

Request Parameters
name type description default constraints multivalued
editable query Flag to restrict returned pages to those, that are editable by the user false boolean no
iscreator query (optional) true when only the pages created by the user shall be returned false boolean no
iseditor query (optional) true when only the pages last edited by the user shall be returned false boolean no
language query Optional filtering for page languages. Defaults to no filtering (i.e. returning pages of all languages). Filtering can be done by language code or ID.     yes
nodeId query Optional node ID for getting pages of a single node/channel only   int no
online query (optional) true to restrict to online pages, false to restrict to offline pages   boolean no
page query Returned page, if paging is used. Paging starts with 1 1 int no
pageSize query Page size for paging. If this is set to -1 no paging is used (all matching items are returned). Setting this to 0 will return no items. -1 int no
perms query Flag to add permission information for the returned items. false boolean no
q query Query string for filtering     no
sort query Comma separated list of sorted attributes. Each attribute name may be prefixed with + for sorting in ascending order or - for sorting in descending order name   no
status query Optional filtering for validity status. Defaults to no filtering (i.e. returning all pages with external links)   "invalid" or "unchecked" or "valid" yes
Response Codes
code condition
200 The pages containing external links are returned.
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions.
405 The feature link_checker is not activated.
Response Body
media type data type description
application/json PageList (JSON) response containing a list of pages with external links

Example

Request
GET /linkChecker/pages
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "items" : [ { }, { } ],
  "hasMoreItems" : true,
  "numItems" : 12345,
  "perms" : {
    "property1" : [ "deleteform", "create" ],
    "property2" : [ "create", "edit" ]
  },
  "stagingStatus" : {
    "property1" : {
      "packageName" : "...",
      "included" : true
    },
    "property2" : {
      "packageName" : "...",
      "included" : true
    }
  },
  "messages" : [ { }, { } ],
  "responseInfo" : {
    "responseCode" : "OK",
    "responseMessage" : "...",
    "property" : "..."
  }
}
                
              

GET /linkChecker/stats

Get link checker statistics

Request Parameters
name type description constraints
nodeId query optional node ID for getting node specific statistics int
online query (optional) true to restrict to online pages, false to restrict to offline pages boolean
Response Codes
code condition
200 LinkChecker statistics are returned.
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions.
405 The feature link_checker is not activated.
Response Body
media type data type description
application/json ExternalLinkStatistics (JSON) statistics response

Example

Request
GET /linkChecker/stats
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "lastRun" : 12345,
  "valid" : 12345,
  "invalid" : 12345,
  "unchecked" : 12345,
  "messages" : [ { }, { } ],
  "responseInfo" : {
    "responseCode" : "OK",
    "responseMessage" : "...",
    "property" : "..."
  }
}
                
              

POST /linkChecker/pages/{id}

Update the validity status for external links contained in the page. Update permissions on the page are required.

Request Parameters
name type description
id path page ID
Request Body
media type data type description
application/json UpdateExternalLinkStatusRequest (JSON) request containing external links with updated status
Response Codes
code condition
200 The status of the posted external links has been updated.
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions.
405 The feature link_checker is not activated.
Response Body
media type data type description
application/json GenericResponse (JSON) generic response

Example

Request
POST /linkChecker/pages/{id}
Content-Type: application/json
Accept: application/json

                
{
  "items" : [ {
    "id" : 8,
    "contentId" : 115,
    "contenttagId" : 685,
    "contenttagName" : "gtxalohapagelink2",
    "valueId" : 2859,
    "partName" : "URL",
    "url" : "https://totally.invalid.url/",
    "text" : "Webshop",
    "lastCheckTimestamp" : 1591693475,
    "lastStatus" : "invalid",
    "lastReason" : "unknown host",
    "history" : [ {
      "timestamp" : 1591693475,
      "status" : "invalid",
      "reason" : "unknown host"
    }, {
      "timestamp" : 1591693475,
      "status" : "invalid",
      "reason" : "unknown host"
    } ]
  }, {
    "id" : 8,
    "contentId" : 115,
    "contenttagId" : 685,
    "contenttagName" : "gtxalohapagelink2",
    "valueId" : 2859,
    "partName" : "URL",
    "url" : "https://totally.invalid.url/",
    "text" : "Webshop",
    "lastCheckTimestamp" : 1591693475,
    "lastStatus" : "invalid",
    "lastReason" : "unknown host",
    "history" : [ {
      "timestamp" : 1591693475,
      "status" : "invalid",
      "reason" : "unknown host"
    }, {
      "timestamp" : 1591693475,
      "status" : "invalid",
      "reason" : "unknown host"
    } ]
  } ]
}
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "messages" : [ { }, { } ],
  "responseInfo" : {
    "responseCode" : "OK",
    "responseMessage" : "...",
    "property" : "..."
  }
}
                
              

POST /linkChecker/pages/{pageId}/links/{id}

Update a link (optionally together with other occurrences) by replacing the URL with the given URL.

Request Parameters
name type description default constraints
id path link ID   required int
pageId path page ID    
wait query time in ms for the request to be done in foreground 0 long
Request Body
media type data type description
application/json ReplaceExternalLinkRequest (JSON) request containing the new URL and the replace scope
Response Codes
code condition
200 Updating the links has been started.
401 No valid sid and session secret cookie were provided.
403 User has insufficient permissions.
405 The feature link_checker is not activated.
Response Body
media type data type description
application/json GenericResponse (JSON) response

Example

Request
POST /pages/115/links/8
Content-Type: application/json
Accept: application/json

                
{
  "url" : "https://totally.valid.url/",
  "scope" : "all"
}
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "messages" : [ {
    "message" : "Occurrences have been replaced in 12 pages.\n4 pages could not be edited due to missing permissions.\n1 page was locked by another user.",
    "type" : "INFO",
    "timestamp" : 1591689489516
  } ],
  "responseInfo" : {
    "responseCode" : "OK",
    "responseMessage" : ""
  }
}