Using Investfly API v{{mainData.version}}

Investfly API is a REST based web service that provides access to all of the services provided by investfly.com.

You can download investfly SDK from here.

Download SDK

Operations

This document describes all API calls, their request methods and response structures. Investfly API can consume data in JSON format only. The examples below show JSON request and response.


User Operations

This section describes all user related API


Login

Investfly supports HTTP BASIC Authentication scheme. Once you are authenticated, Investfly will return your
"clientId"
"clientToken"
"expirationTime"
"username"
for your session in response headers. Every subsequent request after that MUST include "Investfly-client-id" and "Investfly-client-token" in request headers. The token will expire after "expirationTime" if there is no activity with the session. However, as long as you are making request before the expiration time, the expiration time gets automatically renewed.

Request
POST https://api.investfly.com/user/login 
Headers:
"Accept":"application/json"
"Content-Type":"application/json"
Authorization = "Basic " + btoa(username + ":" + password)
                    
Response
HTTP/1.1 200 OK

{
  "clientId": "username-ku2p868f",
  "clientToken": "3a81f9e6-ce5c-4824-af4b-bd33716a2553",
  "expirationTime": "Sun Dec 29 09:32:13 EST 2013",
  "username": "username"
}
                    

Log Out

Logout and end your current session.

Request
POST "https://api.investfly.com/user/logout"
Headers:
"Accept":"application/json"
"Content-Type":"application/json"
"investfly-client-id": user1-j307ajgm
"investfly-client-token": 69d0952c-b156-4758-9ee6-fc095122ec67

        
Response
HTTP/1.1 200 OK 
{
  "message": "You are now logged out",
  "type": "INFO"
}
                    


{{api.name}}

{{api.description}}


{{method.summary}}

Request
{{method.verb[0]}}  https://api.investfly.com{{method.path[0]}}?{{queryparam.name}}=[{{queryparam.name}}]&
                                
Headers:

"Accept":"application/json" "Content-Type":"application/json" "investfly-client-id": user1-j307ajgm "investfly-client-token": 69d0952c-b156-4758-9ee6-fc095122ec67
Request Body:

{{getRequest('Investfly_API',api.name,method.summary,method.path[0],method.verb[0]) | json}}

Response
{{getResponse('Investfly_API',api.name,method.summary,method.path[0],method.verb[0]) | json}}
                            

{{stockapi.name}}

{{stockapi.description}}


{{stockmethod.summary}}

{{stockmethod.description}}

Request
{{stockmethod.verb[0]}}  https://api.investfly.com/stockmarket{{stockmethod.path[0]}}?{{queryparam.name}}=[{{queryparam.name}}]&
                        
Headers:

"Accept":"application/json" "Content-Type":"application/json" "investfly-client-id": user1-j307ajgm "investfly-client-token": 69d0952c-b156-4758-9ee6-fc095122ec67
Request body:

{{getRequest('StockMarket_API',stockapi.name,stockmethod.summary,stockmethod.path[0],stockmethod.verb[0]) | json}}

Response
{{getResponse('StockMarket_API',stockapi.name,stockmethod.summary,stockmethod.path[0],stockmethod.verb[0]) | json}}