Description
This endpoint allows you to create a new tracking link resource by sending a JSON object with the necessary data in the request body.
Request
- Method: POST
- URL Endpoint: https://mcpn.us/apiTrackingLink
- Content-Type: application/json
Request Body
The request body must be a JSON object containing the data required to create a new tracking link.
JSON
{
"user": "string",
"apiId": "string",
"name": "string",
"domain": "string",
"url": "string"
}
Field Descriptions:
- user (string): The account user name.
- apiId (string): The account API ID Can be generated from edit profile.
- name (string): The tracking link name that will show on the feature UI.
- domain (string): The subdomain CNAME that will be in use as the short URL, it must point to whitelabel.limecellular.com.
- url (string): The URL required to shorten.
Response
- Status Code: 201 Created
JSON
{
"trackedUrl": “string",
"domain": "string",
"name": "string",
"id": integer,
"url": "string"
}
Field Descriptions:
- id (integer): The unique identifier for the newly created tracking link.
- trackedUrl (string) The short URL created.
- domain (string): The domain used for the short URL.
- url (string): The long URL.
- name (string): The tracking link name.
Error Responses
- 400 Bad Request - If the request body is malformed or missing required fields.
Example JSON:
{
"errorCode": 1100,
"message": "Error with JSON invalid or missing fields",
"statusCode": 400
}
- 401 Unauthorized - If the user is not authenticated to make the request.
Example JSON:
{
"errorCode": 1900,
"message": "user not exists or invalid api id",
"statusCode": 401
}
- 500 Internal Server Error - If there was an error on the server while processing the request.
Example JSON:
{
" errorCode ": "5000",
"message": "Something went wrong, please try again later",
"statusCode": 500
}
Example Request
POST /apiTrackingLink
Content-Type: application/json
{
"user": "myemail@test.com",
"apiId": "123abc456DEF789",
"name": "My Tracking link name",
"domain": "short.mydomain.com",
"url": "https://www.google.com/search?q=short+url"
}
Example Response (Success)
Status Code: 201
JSON
{
"trackedUrl": "https://short.mydomain.com/s/2I?s=@USR@",
"domain": "short.mydomain.com",
"name": "api1",
"id": 142,
"url": "https://www.google.com/search?q=short+url"
}
Comments
0 comments
Article is closed for comments.