Introduction

Welcome to the PEVIO API documentation! Listed below are the various API methods available in PEVIO.

If you are looking for detailed documentation about specific API methods, you can dive right into the documentation itself. If you are encountering issues with rate limits or other scale issues, please have a look at our best practices guide.

Getting Started

To create short links for a single user or site, you can call the PEVIO API's /v1/links/shorten method using your accesss token which you can you can find or generate at here .

We recommend the following approach to develop an application with our API.

Get an API Key/User Token

Steps to get an API key

  • Login or signup with your email or social (oauth) accounts.
  • A user token is a 10 digit randomly generated key per brand which is generated per User per Brand.
  • After successfull creation of your account, go to profile(top nav bar -> profile).
  • On your right you can be able to see your token and also regenerated the token.

Links

Creating a Short Link

/v1/links/shorten

Shoten Parameter

Table below shows the parameters you should specify when creating a Link:

Link property Description
key A 10 digit user access token to verify the user.
url The destination URL you want your short link to point to
domain A reference to the branded domain resource for this branded short link. If not set, https://pev.io is used
title Custom page title of the url.
alias you can create shortlink of your own choice by giving a custom alias name.
notes A description/note you associate to the short link.
tags Tags you want to associate with the short link.
public_stat Flag to show stats page to public or not.(by default it wont show to public unless you supply 1 to the request)
dup_check Flag to check duplicate short link while creating.(by default it will check for duplicate short link in the same account and if you supply 1 to request it will return that link after request is finished or if you supply 0 then it will create a newlink.)
type Type of responce you want (xml/json) i.e content/type .If not provided the default responce is in json.
Examples of valid Link object to POST:
$ curl https://api.pevio.co/v1/links/shorten
    -X POST  
    -d 
    {
      "key": XXXXXXXXXXX,
      "url": http://pevio.co,
      "alias": myfirstrequest,
      "domain": pev.io,
      "notes": A short note for my url,
      "tags": a,b,c,d,
      "public_stat": 1,
      "dup_check": 1,
      "type": json,
     }
Json responce of a successful request
{
"success":true,
"url":"http://pevio.co",
"short_link":"https://pev.io/myfirstrequest",
"title":"page title for the url",
"domain":"domain name of the shorten url",
"notes":"any notes or desctiption related to the shorten url",
"tags":"Tags of the shorten url",
"short_link":"short link created",
"links_created_in_hour":"total links created in last one hour",
"links_created_in_today":"total links created in today",
"links_created_in_month":"total links created in current month",
"total_links_per_hour":"total links available per hour",
"total_links_per_day":"total links available per day",
"total_links_per_month":"total links available per month"
}
Json responce of a failed request
{
"success":0,
"error_code":100,
"error_message":"Invalid Format"
}

Handling errors

Table below shows the type of http status you can get:

Http Status Description
400 Invalid Link object. Double check value for property field. Details about validation failure in error_message field.
500 This is a server error.Please try after sometime or contact admin.

Editing a Short Link

/v1/links/link-edit

Table below shows the parameters you should specify when editing a Link:

Link property Description
key A 10 digit user access token to verify the user.
short_link Full url of the short link you want to edit EX-https://pev.io/TESTSTATS.
alias Alias/Code of the new shortlink.
title Title of the new shortlink.
notes Note/Description of the new shortlink.
public_stat Flag to display public stats
Examples of valid Link object to POST:
$ curl https://api.pevio.co/v1/links/link-edit
    -X POST  
    -d 
    {
      "key": XXXXXXXXXXX,
      "short_link": http://pev.io/TESTSTATS,
      "alias": myfirstrequest,
      "domain": pev.io,
      "notes": A short note for my url,
      "public_stat": 1,
      "type": json,
     }
Json response of a successful request
{
"success":true,
"short_link":"https://pev.io/myfirstrequest",
"title":'Title for my link'
}
Json responce of a failed request
{
"success":0,
"error_code":100,
"error_message":"Invalid Format"
}

Expanding a Short Link

/v1/links/expand

Given a short link or alias , returns the target (long) URL.Table below shows the parameters you should specify expanding a Link:

Link property Description
key A 10 digit user access token to verify the user.
short_link Full url of the short link you want to edit EX-https://pev.io/TESTSTATS.
alias Alias of the link For Example TESTSTATS

Note -:Either short_link or alias must be given as a parameter.

Examples of valid Link object to POST:
$ curl https://api.pevio.co/v1/links/expand
    -X POST  
    -d 
    {
      "key": XXXXXXXXXXX,
      "short_link": http://pev.io/TESTSTATS,
      "type": json,
     }
Another Exmaple by Alias method
$ curl https://api.pevio.co/v1/links/expand
    -X POST  
    -d 
    {
      "key": XXXXXXXXXXX,
      "alias": TESTSTATS,
      "type": json,
     }
Json response of a successful request
{
"success":true,
"alias":"g3Z",
"expand":
{
"short_link":"https:\/\/pev.li\/g3Z",
"url":"http:\/\/www.google.com\/"
}
}

Getting Short Link Details

/v1/links/info

Given a short link or alias , returns the target (long) URL.Table below shows the parameters you should specify:

Link property Description
key A 10 digit user access token to verify the user.
short_link Full url of the short link you want to edit EX-https://pev.io/TESTSTATS.
alias Alias of the link For Example TESTSTATS
Json response of a successful request
{
"success":true,
"alias":"g3Z",
  "info":
  {
  "created_on":"2017-05-09 11:03:01",
  "short_link":"https:\/\/pev.li\/g3Z",
  "url":"http:\/\/www.google.com\/",
  "title":"Google",
  "tags":"njss,fusion"
  }
}

Lookup a Long Url

/v1/links/lookup

Given a long url, returns the Short Url.Table below shows the parameters you should specify expanding a Link:

Link property Description
key A 10 digit user access token to verify the user.
url Full url of the short link you want to edit EX-https://google.com
Examples of valid Link object to POST:
$ curl https://api.pevio.co/v1/links/lookup
    -X POST  
    -d 
    {
      "key": XXXXXXXXXXX,
      "url": https://google.com,
      "type": json,
     }
Sucessfull Response
{
"success":true,
"url":"https:\/\/google.co.in",
"lookup":
	{
	"short_link":"https:\/\/pev.io\/g49"
	}
}

Bulk Short links

You can create multiple shortlinks by uploading your excel sheets.

Download Formats for uploading Excel sheets

Link Metrics

Getting Count Of A ShortLink

/v3/click/count

Returns the number of clicks on a single ShortLink.Table below shows the parameters you should specify :

Link property Description
key A 10 digit user access token to verify the user.
short_url Full url of the short link you want get count EX-https://pev.io/TESTSTATS
start_date Start date of count date (By default it is based on plan max date)
end_date End date of count date (By default it is based on plan max date)
daily Flag to get stats response based on date
type Json/Xml response to get from our server.(By Default its Json)
Examples of valid Click object to GET:
$ curl https://api.pevio.co/v1/clicks/count
    -X GET  
    -d 
    {
      "key": XXXXXXXXXXX,
      "short_link": http://pev.io/TESTSTATS,
      "start_date": 2017-05-01,
      "end_date": 2017-05-20,
      "daily": 1,
      "type": xml,
     }
Response Of a Successful Request:
{
"success":true,
"short_link":"https:\/\/pev.io\/TESTSTATS",
"alias":"TESTSTATS",
"total_visits":151,
"unique_visits":151,
"dates":[
	{"unique_visits":1,"total_visits":1,"date":"2017-05-08"},
	{"unique_visits":150,"total_visits":150,"date":"2017-05-09"}
	]
}
Here total_visits visits indicated number of visitors visited https://pev.io/TESTSTATS page from 2017-05-08(start_date) to 2017-05-09(end_date).