This API provides two endpoints for managing offer codes and associated shortcodes. Both endpoints use POST
methods and expect data in form format with an API key for authentication.
To request an API-Key, DM @steppsr on X.
/api/v1/getoffer
POST
api_key
(string, optional for Seedling, required for others): The API key for authentication.short_code
(string, required): The short code to look up the offer.Description: This endpoint fetches the offer code, description, and a unique offer ID based on the provided short_code
from the database.
/api/v1/getshortcode
POST
api_key
(string, optional for Seedling, required for others): The API key for authentication.offer_code
(string, required): The offer code you want to associate with a new short code.description
(string, optional): A description for the offer. If provided, it will be stored with the offer code.Description: This endpoint generates or retrieves a short code for a given offer_code
. If no short code exists for the offer code, a new unique short code is generated, inserted into the database, and returned.
api_key
parameter for all tiers except Seedling.
status
field indicating either “success” or “error”.message
field in the JSON response provides details on the error.curl
# For GET Offer
curl -X POST -d "api_key=YOUR_API_KEY&short_code=9K1xX" "https://offerco.de/api/v1/getoffer"
# For GET Shortcode (standard form method)
curl -X POST -d "api_key=YOUR_API_KEY&offer_code=OFFER_CODE&description=This%20is%20a%20test%20offer" "https://offerco.de/api/v1/getshortcode"
# For GET Shortcode (using form-data to avoid URL encoding)
curl -X POST -F "api_key=YOUR_API_KEY" -F "offer_code=OFFER_CODE" -F "description=This is a test offer" "https://offerco.de/api/v1/getshortcode"
Javascript
// For GET Offer
fetch('https://offerco.de/api/v1/getoffer', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
body: 'api_key=YOUR_API_KEY&short_code=XXXXX'
})
.then(response => response.json())
.then(data => console.log(data));
// For GET Shortcode (standard form method)
fetch('https://offerco.de/api/v1/getshortcode', {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
body: 'api_key=YOUR_API_KEY&offer_code=OFFER_CODE&description=This%20is%20a%20test%20offer'
})
.then(response => response.json())
.then(data => console.log(data));
// For GET Shortcode (using FormData to avoid manual URL encoding)
const formData = new FormData();
formData.append('api_key', 'YOUR_API_KEY');
formData.append('offer_code', 'OFFER_CODE');
formData.append('description', 'This is a test offer');
fetch('https://offerco.de/api/v1/getshortcode', {
method: 'POST',
body: formData
})
.then(response => response.json())
.then(data => console.log(data));
{
"status": "success",
"data": {
"short_code": "string",
"offer_code": "string",
"description": "string",
"offer_id": "string"
}
}
{
"status": "error",
"data": [],
"message": "string"
}