Updated API docs including new endpoint and updating params for short code creation

This commit is contained in:
Alejandro Celaya 2018-01-07 20:54:02 +01:00
parent 6f7ce709ca
commit ecebdbbfa8
2 changed files with 93 additions and 0 deletions

View File

@ -116,6 +116,7 @@
}
}
},
"post": {
"tags": [
"ShortCodes"
@ -140,6 +141,34 @@
"type": "string"
}
},
{
"name": "validSince",
"in": "formData",
"description": "The date (in ISO-8601 format) from which this short code will be valid",
"required": false,
"type": "string"
},
{
"name": "validUntil",
"in": "formData",
"description": "The date (in ISO-8601 format) until which this short code will be valid",
"required": false,
"type": "string"
},
{
"name": "customSlug",
"in": "formData",
"description": "A unique custom slug to be used instead of the generated short code",
"required": false,
"type": "string"
},
{
"name": "maxVisits",
"in": "formData",
"description": "The maximum number of allowed visits for this short code",
"required": false,
"type": "number"
},
{
"$ref": "../parameters/Authorization.json"
}

View File

@ -54,5 +54,69 @@
}
}
}
},
"put": {
"tags": [
"ShortCodes"
],
"summary": "Edit short code",
"description": "Update certain meta arguments from an existing short URL.",
"parameters": [
{
"name": "shortCode",
"in": "path",
"type": "string",
"description": "The short code to edit.",
"required": true
},
{
"name": "validSince",
"in": "formData",
"description": "The date (in ISO-8601 format) from which this short code will be valid",
"required": false,
"type": "string"
},
{
"name": "validUntil",
"in": "formData",
"description": "The date (in ISO-8601 format) until which this short code will be valid",
"required": false,
"type": "string"
},
{
"name": "maxVisits",
"in": "formData",
"description": "The maximum number of allowed visits for this short code",
"required": false,
"type": "number"
},
{
"$ref": "../parameters/Authorization.json"
}
],
"responses": {
"204": {
"description": "The short code has been properly updated."
},
"400": {
"description": "Provided meta arguments are invalid.",
"schema": {
"$ref": "../definitions/Error.json"
}
},
"404": {
"description": "No short URL was found for provided short code.",
"schema": {
"$ref": "../definitions/Error.json"
}
},
"500": {
"description": "Unexpected error.",
"schema": {
"$ref": "../definitions/Error.json"
}
}
}
}
}