Validate URL

Virgin Money Giving has closed

Page and account creation APIs are now unavailable so please consider your use of our APIs and how this affects you. All other APIs will be available until 18 February. If you have any questions please take a look at our Q&A.

Read our Q&A

Validate URL

When creating a new fundraising account, a unique URL is required. A team-based fundraising page also requires a unique URL.

This API checks a URL to see if it's available to be used.

A fundraising account is accessed by the following URL:

Most fundraisers use their own name as the {url}. Their account URL will be the same for any event they take part in 

A team fundraising page is accessed by the following URL:

Most teams choose their {url} based on their team name and perhaps the event e.g. SeabrookSealsChannelRelayTeam

If the URL is not unique, the API returns a list of alternatives in the message details.

URL

Operation type: GET

This validates a URL for a fundraising account:

This validates a URL for a team page:

Parameters

Parameter Required Data type Description
url True Varchar(45) This is the URL you want to validate.
api_key True Varchar(24) This is your key that allows you access to the VMG APIs.

Response

OutcomeFurther information
Success

If the URL is available a status 200 is returned:

  • Status 200: OK
Error

Sample error:

If the URL is in use then the following is returned:

  • Error code: 001.00.010
  • Error message: This URL is unavailable. Please select an alternative URL.
  • Message details: List of alternative URLs that are available. These will be the URL passed followed by a sequence. E.g. If a url of 'mypage' was passed and unavailable the following would be returned, providing the URL’s were available:

    mypage1
    mypage2
    mypage3 etc

Click here for a full list of API error codes.

XML response examples

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<urlCheck>
  <requestedUrl>mytesturl</requestedUrl>
  <urlType>fundraiser</urlType>
  <available>true</available>
</urlCheck>
<connectErrors>
<error>
<errorCode>001.00.010</errorCode>
<errorMessage>This URL is unavailable. Please select an alternative URL.</errorMessage>
<messageDetails>mytesturl2</messageDetails>
<messageDetails>mytesturl3</messageDetails>
<messageDetails>mytesturl4</messageDetails>
<messageDetails>mytesturl5</messageDetails>
<messageDetails>mytesturl6</messageDetails>
</error>
</connectErrors>

JSON response examples

{
    "requestedUrl": "mytesturl",
    "urlType": "fundraiser",
    "available": true,
    "message": null,
    "alternateUrlList": []
}
{
    "errors":
    [
        {
            "responseCode": null,
            "errorCode": "001.00.010",
            "errorMessage": "This URL is unavailable. Please select an alternative URL.",
            "messageDetails":
            [
                "mytesturl2",
                "mytesturl3",
                "mytesturl4",
                "mytesturl5",
                "mytesturl6"
            ],
            "inputDetails": null
        }
    ]
}