Contains 2 endpoints:
- [POST] OptimizeAd - Checks if text with the provided title, description, and keywords fits in the character limit for the specified platform. And returns the optimized text to fit the maximum amount of provided data.
- [GET] GetSupportedPlatforms - Returns all social media platforms that have a character limit lower than the provided one. If no limit is provided, return all known social platforms.
- Clone this repository
- Start the project
- Test it
-
Via Swagger:
- You will be redirected to Swagger in your browser or go directly to https://localhost:7095/index.html
- Choose the endpoint
- Press "Try it out" button
- Enter data
- Press "Execute" button
-
Via Postman:
- Go to Postman or you can find the link with examples below:
- Use a link with examples or one of the endpoint links:
- Enter parameters
- Press "Send" button
Here is a visualized flow for the OptimizeAd method for a better understanding of which parts of text are included:
If you want to export examples to Postman using raw data, you can find it below:
Click to reveal the json text
{
"info": {
"_postman_id": "1f03154e-3e8f-44cf-9b24-b01a4fe57726",
"name": "AdOptimizer",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
"_exporter_id": "38241899"
},
"item": [
{
"name": "GetSupportedPlatforms",
"item": [
{
"name": "SmallLimit",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "https://localhost:7095/api/get-supported-platforms?CharacterLimit=200",
"protocol": "https",
"host": [
"localhost"
],
"port": "7095",
"path": [
"api",
"get-supported-platforms"
],
"query": [
{
"key": "CharacterLimit",
"value": "200"
}
]
}
},
"response": []
},
{
"name": "MiddleLimit",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "https://localhost:7095/api/get-supported-platforms?CharacterLimit=300",
"protocol": "https",
"host": [
"localhost"
],
"port": "7095",
"path": [
"api",
"get-supported-platforms"
],
"query": [
{
"key": "CharacterLimit",
"value": "300"
}
]
}
},
"response": []
},
{
"name": "BigLimit",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "https://localhost:7095/api/get-supported-platforms?CharacterLimit=2000",
"protocol": "https",
"host": [
"localhost"
],
"port": "7095",
"path": [
"api",
"get-supported-platforms"
],
"query": [
{
"key": "CharacterLimit",
"value": "2000"
}
]
}
},
"response": []
},
{
"name": "NoLimit",
"request": {
"method": "GET",
"header": [],
"url": {
"raw": "https://localhost:7095/api/get-supported-platforms",
"protocol": "https",
"host": [
"localhost"
],
"port": "7095",
"path": [
"api",
"get-supported-platforms"
]
}
},
"response": []
}
]
},
{
"name": "OptimizeAd",
"item": [
{
"name": "EmptyRequest",
"request": {
"method": "POST",
"header": [],
"url": {
"raw": "https://localhost:7095/api/optimize-ad",
"protocol": "https",
"host": [
"localhost"
],
"port": "7095",
"path": [
"api",
"optimize-ad"
]
}
},
"response": []
},
{
"name": "EmptyPlatform",
"request": {
"method": "POST",
"header": [],
"url": {
"raw": "https://localhost:7095/api/optimize-ad?Title=title&Platform= ",
"protocol": "https",
"host": [
"localhost"
],
"port": "7095",
"path": [
"api",
"optimize-ad"
],
"query": [
{
"key": "Title",
"value": "title"
},
{
"key": "Platform",
"value": " "
}
]
}
},
"response": []
},
{
"name": "UnknownPlatform",
"request": {
"method": "POST",
"header": [],
"url": {
"raw": "https://localhost:7095/api/optimize-ad?Title=title&Platform=test",
"protocol": "https",
"host": [
"localhost"
],
"port": "7095",
"path": [
"api",
"optimize-ad"
],
"query": [
{
"key": "Title",
"value": "title"
},
{
"key": "Platform",
"value": "test"
}
]
}
},
"response": []
},
{
"name": "TextWithIntroTitleDescriptionKeywords",
"request": {
"method": "POST",
"header": [],
"url": {
"raw": "https://localhost:7095/api/optimize-ad?Title=.Net developer&Description=This is the best job&Keywords=software&Keywords=developer&Platform=twitter",
"protocol": "https",
"host": [
"localhost"
],
"port": "7095",
"path": [
"api",
"optimize-ad"
],
"query": [
{
"key": "Title",
"value": ".Net developer"
},
{
"key": "Description",
"value": "This is the best job"
},
{
"key": "Keywords",
"value": "software"
},
{
"key": "Keywords",
"value": "developer"
},
{
"key": "Platform",
"value": "twitter"
}
]
}
},
"response": []
},
{
"name": "TextWithIntroTitleLink",
"request": {
"method": "POST",
"header": [],
"url": {
"raw": "https://localhost:7095/api/optimize-ad?Title=.Net developer&Description=Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere, mi et blandit convallis, justo purus consectetur dui, id tempor neque est sit amet nunc. Suspendisse lacus urna, maximus sodales tristique sed, bibendum at nibh. Maecenas viverra scelerisque est id vehicula. Nam maximus metus.&Platform=twitter",
"protocol": "https",
"host": [
"localhost"
],
"port": "7095",
"path": [
"api",
"optimize-ad"
],
"query": [
{
"key": "Title",
"value": ".Net developer"
},
{
"key": "Description",
"value": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere, mi et blandit convallis, justo purus consectetur dui, id tempor neque est sit amet nunc. Suspendisse lacus urna, maximus sodales tristique sed, bibendum at nibh. Maecenas viverra scelerisque est id vehicula. Nam maximus metus."
},
{
"key": "Platform",
"value": "twitter"
}
]
}
},
"response": []
},
{
"name": "TextWithIntroTitleLinkKeywords",
"request": {
"method": "POST",
"header": [],
"url": {
"raw": "https://localhost:7095/api/optimize-ad?Title=.Net developer&Description=Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere, mi et blandit convallis, justo purus consectetur dui, id tempor neque est sit amet nunc. Suspendisse lacus urna, maximus sodales tristique sed, bibendum at nibh. Maecenas viverra scelerisque est id vehicula. Nam maximus metus.&Platform=twitter",
"protocol": "https",
"host": [
"localhost"
],
"port": "7095",
"path": [
"api",
"optimize-ad"
],
"query": [
{
"key": "Title",
"value": ".Net developer"
},
{
"key": "Description",
"value": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere, mi et blandit convallis, justo purus consectetur dui, id tempor neque est sit amet nunc. Suspendisse lacus urna, maximus sodales tristique sed, bibendum at nibh. Maecenas viverra scelerisque est id vehicula. Nam maximus metus."
},
{
"key": "Platform",
"value": "twitter"
}
]
}
},
"response": []
},
{
"name": "TextWithIntroTitleLink",
"request": {
"method": "POST",
"header": [],
"url": {
"raw": "https://localhost:7095/api/optimize-ad?Title=.Net developer&Platform=twitter",
"protocol": "https",
"host": [
"localhost"
],
"port": "7095",
"path": [
"api",
"optimize-ad"
],
"query": [
{
"key": "Title",
"value": ".Net developer"
},
{
"key": "Platform",
"value": "twitter"
}
]
}
},
"response": []
}
]
}
]
}
