cURL Java Javascript Node Perl Python PHP Ruby Go C# Visual Basic Groovy Objective-C Swift
curl -- include \
-- header "Authorization: Bearer Q0xJMDAAAAAAAAABUYDOL8O67z2B7oVbKs+V2x2nfGMx3GascjMPJxcGFxvOyg==" \
-- header "Accept: application/json" \
'https://rest.smartvault.com/nodes/app/{path}?children=&acl=&eprop=&search=&page=&per_page=&sort=&direction='
import javax . ws . rs . client . Client ;
import javax . ws . rs . client . ClientBuilder ;
import javax . ws . rs . client . Entity ;
import javax . ws . rs . core . Response ;
import javax . ws . rs . core . MediaType ;
Client client = ClientBuilder . newClient ( ) ;
Response response = client . target ( "https://rest.smartvault.com/nodes/app/{path}?children=&acl=&eprop=&search=&page=&per_page=&sort=&direction=" )
. request ( MediaType . TEXT_PLAIN_TYPE )
. header ( "Authorization" , "Bearer Q0xJMDAAAAAAAAABUYDOL8O67z2B7oVbKs+V2x2nfGMx3GascjMPJxcGFxvOyg==" )
. header ( "Accept" , "application/json" )
. get ( ) ;
System . out . println ( "status: " + response . getStatus ( ) ) ;
System . out . println ( "headers: " + response . getHeaders ( ) ) ;
System . out . println ( "body:" + response . readEntity ( String . class ) ) ;
var request = new XMLHttpRequest ( ) ;
request . open ( 'GET' , 'https://rest.smartvault.com/nodes/app/{path}?children=&acl=&eprop=&search=&page=&per_page=&sort=&direction=' ) ;
request . setRequestHeader ( 'Authorization' , 'Bearer Q0xJMDAAAAAAAAABUYDOL8O67z2B7oVbKs+V2x2nfGMx3GascjMPJxcGFxvOyg==' ) ;
request . setRequestHeader ( 'Accept' , 'application/json' ) ;
request . onreadystatechange = function ( ) {
if ( this . readyState === 4 ) {
console . log ( 'Status:' , this . status ) ;
console . log ( 'Headers:' , this . getAllResponseHeaders ( ) ) ;
console . log ( 'Body:' , this . responseText ) ;
}
} ;
request . send ( ) ;
var request = require ( 'request' ) ;
request ( {
method : 'GET' ,
url : 'https://rest.smartvault.com/nodes/app/{path}?children=&acl=&eprop=&search=&page=&per_page=&sort=&direction=' ,
headers : {
'Authorization' : 'Bearer Q0xJMDAAAAAAAAABUYDOL8O67z2B7oVbKs+V2x2nfGMx3GascjMPJxcGFxvOyg==' ,
'Accept' : 'application/json'
} } , function ( error , response , body ) {
console . log ( 'Status:' , response . statusCode ) ;
console . log ( 'Headers:' , JSON . stringify ( response . headers ) ) ;
console . log ( 'Response:' , body ) ;
} ) ;
$ ENV { 'PERL_LWP_SSL_VERIFY_HOSTNAME' } = 0 ;
use LWP : : UserAgent ;
use strict ;
use warnings ;
use 5.010 ;
use Cpanel : : JSON : : XS qw ( encode_json decode_json ) ;
my $ua = LWP : : UserAgent - > new ;
$ua - > default_header ( "Authorization" => "Bearer Q0xJMDAAAAAAAAABUYDOL8O67z2B7oVbKs+V2x2nfGMx3GascjMPJxcGFxvOyg==" ) ;
$ua - > default_header ( "Accept" => "application/json" ) ;
my $response = $ua - > get ( "https://rest.smartvault.com/nodes/app/{path}?children=&acl=&eprop=&search=&page=&per_page=&sort=&direction=" ) ;
print $response - > as_string ;
from urllib2 import Request , urlopen
headers = {
'Authorization' : 'Bearer Q0xJMDAAAAAAAAABUYDOL8O67z2B7oVbKs+V2x2nfGMx3GascjMPJxcGFxvOyg==' ,
'Accept' : 'application/json'
}
request = Request ( 'https://rest.smartvault.com/nodes/app/{path}?children=&acl=&eprop=&search=&page=&per_page=&sort=&direction=' , headers = headers )
response_body = urlopen ( request ) . read ( )
print response_body
< ? php
$ch = curl_init ( ) ;
curl_setopt ( $ch , CURLOPT_URL , "https://rest.smartvault.com/nodes/app/{path}?children=&acl=&eprop=&search=&page=&per_page=&sort=&direction=" ) ;
curl_setopt ( $ch , CURLOPT_RETURNTRANSFER , TRUE ) ;
curl_setopt ( $ch , CURLOPT_HEADER , FALSE ) ;
curl_setopt ( $ch , CURLOPT_HTTPHEADER , array (
"Authorization: Bearer Q0xJMDAAAAAAAAABUYDOL8O67z2B7oVbKs+V2x2nfGMx3GascjMPJxcGFxvOyg==" ,
"Accept: application/json"
) ) ;
$response = curl_exec ( $ch ) ;
curl_close ( $ch ) ;
var_dump ( $response ) ;
require 'rubygems' if RUBY_VERSION < '1.9'
require 'rest_client'
headers = {
: authorization => 'Bearer Q0xJMDAAAAAAAAABUYDOL8O67z2B7oVbKs+V2x2nfGMx3GascjMPJxcGFxvOyg==' ,
: accept => 'application/json'
}
response = RestClient . get 'https://rest.smartvault.com/nodes/app/{path}?children=&acl=&eprop=&search=&page=&per_page=&sort=&direction=' , headers
puts response
package main
import (
"fmt"
"io/ioutil"
"net/http"
)
func main ( ) {
client : = & http . Client { }
req , _ : = http . NewRequest ( "GET" , "https://rest.smartvault.com/nodes/app/{path}?children=&acl=&eprop=&search=&page=&per_page=&sort=&direction=" , nil )
req . Header . Add ( "Authorization" , "Bearer Q0xJMDAAAAAAAAABUYDOL8O67z2B7oVbKs+V2x2nfGMx3GascjMPJxcGFxvOyg==" )
req . Header . Add ( "Accept" , "application/json" )
resp , err : = client . Do ( req )
if err != nil {
fmt . Println ( "Errored when sending request to the server" )
return
}
defer resp . Body . Close ( )
resp_body , _ : = ioutil . ReadAll ( resp . Body )
fmt . Println ( resp . Status )
fmt . Println ( string ( resp_body ) )
}
using System ;
using System . Net . Http ;
var baseAddress = new Uri ( "https://rest.smartvault.com/" ) ;
using ( var httpClient = new HttpClient { BaseAddress = baseAddress } )
{
httpClient . DefaultRequestHeaders . TryAddWithoutValidation ( "Authorization" , "Bearer Q0xJMDAAAAAAAAABUYDOL8O67z2B7oVbKs+V2x2nfGMx3GascjMPJxcGFxvOyg==" ) ;
httpClient . DefaultRequestHeaders . TryAddWithoutValidation ( "accept" , "application/json" ) ;
using ( var response = await httpClient . GetAsync ( "nodes/app/{path}{?children,acl,eprop,search,page,per_page,sort,direction,record_id}" ) )
{
string responseData = await response . Content . ReadAsStringAsync ( ) ;
}
}
Dim request = TryCast ( System . Net . WebRequest . Create ( "https://rest.smartvault.com/nodes/app/{path}?children=&acl=&eprop=&search=&page=&per_page=&sort=&direction=" ) , System . Net . HttpWebRequest )
request . Method = "GET"
request . Headers . Add ( "Authorization" , "Bearer Q0xJMDAAAAAAAAABUYDOL8O67z2B7oVbKs+V2x2nfGMx3GascjMPJxcGFxvOyg==" )
request . Accept = "application/json"
request . ContentLength = 0
Dim responseContent As String
Using response = TryCast ( request . GetResponse ( ) , System . Net . HttpWebResponse )
Using reader = New System . IO . StreamReader ( response . GetResponseStream ( ) )
responseContent = reader . ReadToEnd ( )
End Using
End Using
import groovyx . net . http . RESTClient
import static groovyx . net . http . ContentType . JSON
import groovy . json . JsonSlurper
import groovy . json . JsonOutput
@ Grab ( group = 'org.codehaus.groovy.modules.http-builder' , module = 'http-builder' , version = '0.5.0' )
def client = new RESTClient ( "https://rest.smartvault.com" )
def emptyHeaders = [ : ]
emptyHeaders . "Authorization" = "Bearer Q0xJMDAAAAAAAAABUYDOL8O67z2B7oVbKs+V2x2nfGMx3GascjMPJxcGFxvOyg=="
emptyHeaders . "Accept" = "application/json"
response = client . get ( path : "/nodes/app/{path}{?children,acl,eprop,search,page,per_page,sort,direction,record_id}" , headers : emptyHeaders )
println ( "Status:" + response . status )
if ( response . data ) {
println ( "Content Type: " + response . contentType )
println ( "Body:\n" + JsonOutput . prettyPrint ( JsonOutput . toJson ( response . data ) ) )
}
NSURL * URL = [ NSURL URLWithString : @ "https://rest.smartvault.com/nodes/app/{path}?children=&acl=&eprop=&search=&page=&per_page=&sort=&direction=" ] ;
NSMutableURLRequest * request = [ NSMutableURLRequest requestWithURL : URL ] ;
[ request setHTTPMethod : @ "GET" ] ;
[ request setValue : @ "Bearer Q0xJMDAAAAAAAAABUYDOL8O67z2B7oVbKs+V2x2nfGMx3GascjMPJxcGFxvOyg==" forHTTPHeaderField : @ "Authorization" ] ;
[ request setValue : @ "application/json" forHTTPHeaderField : @ "Accept" ] ;
NSURLSession * session = [ NSURLSession sharedSession ] ;
NSURLSessionDataTask * task = [ session dataTaskWithRequest : request
completionHandler :
^ ( NSData * data , NSURLResponse * response , NSError * error ) {
if ( error ) {
return ;
}
if ( [ response isKindOfClass : [ NSHTTPURLResponse class ] ] ) {
NSLog ( @ "Response HTTP Status code: %ld\n" , ( long ) [ ( NSHTTPURLResponse * ) response statusCode ] ) ;
NSLog ( @ "Response HTTP Headers:\n%@\n" , [ ( NSHTTPURLResponse * ) response allHeaderFields ] ) ;
}
NSString * body = [ [ NSString alloc ] initWithData : data encoding : NSUTF8StringEncoding ] ;
NSLog ( @ "Response Body:\n%@\n" , body ) ;
} ] ;
[ task resume ] ;
import Foundation
let url = URL ( string : "https://rest.smartvault.com/nodes/app/{path}?children=&acl=&eprop=&search=&page=&per_page=&sort=&direction=" ) !
var request = URLRequest ( url : url )
request . addValue ( "Bearer Q0xJMDAAAAAAAAABUYDOL8O67z2B7oVbKs+V2x2nfGMx3GascjMPJxcGFxvOyg==" , forHTTPHeaderField : "Authorization" )
request . addValue ( "application/json" , forHTTPHeaderField : "Accept" )
let task = URLSession . shared . dataTask ( with : request ) { data , response , error in
if let response = response {
print ( response )
if let data = data , let body = String ( data : data , encoding : . utf8 ) {
print ( body )
}
} else {
print ( error ?? "Unknown error" )
}
}
task . resume ( )
After adding an app, it will show under the default app type path. You'll need to query using the children param like /nodes/app?children=4
In the example, if you check under the "QuickBooks Online" node, you'll find the new application that we previously added called "QuickBooks". It has its own default structure and a image called "SCREENS.png" that we added just for testing purposes.
this as it will delete the app instance and its children, meaning that you'd have to go through the whole process again of adding the app to your account.