IntroductionBefore you beginTerminologyGetting startedGroupsFilesFoldersTemplatesEmail templatesAppsErrors
Authorization
Accounts
Entities
User accounts
Create a new account
You can have your application automatically create accounts for your clients in SmartVault.
This saves them the extra step of having to go through the sign up process themselves.
After adding the account, if everything went well, the email specified will receive an email as confirmation of the new account created.
Remember you'll need to use the client token while using the create new account endpoint. Also, the info you add while the user is logged in will be wiped out once the user signs out of the account.
endpoints
POST/auto/snew
Body parameters
Show body params
Request
Headers:Content-Type:application/jsonAuthorization:Basic {{client_token}}Accept:application/jsonBody:{"email": "sally.cpa@smartvault.com","first_name": "sally","last_name": "cpa","account_name": "sallysfirm","email_validated": true}
curl --include \--request POST \--header "Content-Type: application/json" \--header "Authorization: Basic dGVzdHVzZXJAc21hcnR2YXVsdC5jb206UTB4Sk1EQUFBQUFBQUFBQlVZRE9MOE82N3oyQjdvVmJLcytWMngybmZHTXgzR2FzY2pNUEp4Y0dGeHZPeWc9PQ==" \--header "Accept: application/json" \--data-binary "{\"email\": \"sally.cpa@smartvault.com\",\"first_name\": \"sally\",\"last_name\": \"cpa\",\"account_name\": \"sallysfirm\",\"email_validated\": true}" \'https://rest.smartvault.com/auto/snew'
// Maven : Add these dependencies to your pom.xml (java6+)// <dependency>// <groupId>org.glassfish.jersey.core</groupId>// <artifactId>jersey-client</artifactId>// <version>2.8</version>// </dependency>// <dependency>// <groupId>org.glassfish.jersey.media</groupId>// <artifactId>jersey-media-json-jackson</artifactId>// <version>2.8</version>// </dependency>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();Entity payload = Entity.json("{ \"email\": \"sally.cpa@smartvault.com\", \"first_name\": \"sally\", \"last_name\": \"cpa\", \"account_name\": \"sallysfirm\", \"email_validated\": true}");Response response = client.target("https://rest.smartvault.com/auto/snew").request(MediaType.APPLICATION_JSON_TYPE).header("Authorization", "Basic dGVzdHVzZXJAc21hcnR2YXVsdC5jb206UTB4Sk1EQUFBQUFBQUFBQlVZRE9MOE82N3oyQjdvVmJLcytWMngybmZHTXgzR2FzY2pNUEp4Y0dGeHZPeWc9PQ==").header("Accept", "application/json").post(payload);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('POST', 'https://rest.smartvault.com/auto/snew');request.setRequestHeader('Content-Type', 'application/json');request.setRequestHeader('Authorization', 'Basic dGVzdHVzZXJAc21hcnR2YXVsdC5jb206UTB4Sk1EQUFBQUFBQUFBQlVZRE9MOE82N3oyQjdvVmJLcytWMngybmZHTXgzR2FzY2pNUEp4Y0dGeHZPeWc9PQ==');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);}};var body = {'email': 'sally.cpa@smartvault.com','first_name': 'sally','last_name': 'cpa','account_name': 'sallysfirm','email_validated': true};request.send(JSON.stringify(body));
var request = require('request');request({method: 'POST',url: 'https://rest.smartvault.com/auto/snew',headers: {'Content-Type': 'application/json','Authorization': 'Basic dGVzdHVzZXJAc21hcnR2YXVsdC5jb206UTB4Sk1EQUFBQUFBQUFBQlVZRE9MOE82N3oyQjdvVmJLcytWMngybmZHTXgzR2FzY2pNUEp4Y0dGeHZPeWc9PQ==','Accept': 'application/json'},body: "{ \"email\": \"sally.cpa@smartvault.com\", \"first_name\": \"sally\", \"last_name\": \"cpa\", \"account_name\": \"sallysfirm\", \"email_validated\": true}"}, function (error, response, body) {console.log('Status:', response.statusCode);console.log('Headers:', JSON.stringify(response.headers));console.log('Response:', body);});
var request = require('request');request({method: 'POST',url: 'https://rest.smartvault.com/auto/snew',headers: {'Content-Type': 'application/json','Authorization': 'Basic dGVzdHVzZXJAc21hcnR2YXVsdC5jb206UTB4Sk1EQUFBQUFBQUFBQlVZRE9MOE82N3oyQjdvVmJLcytWMngybmZHTXgzR2FzY2pNUEp4Y0dGeHZPeWc9PQ==','Accept': 'application/json'},body: "{ \"email\": \"sally.cpa@smartvault.com\", \"first_name\": \"sally\", \"last_name\": \"cpa\", \"account_name\": \"sallysfirm\", \"email_validated\": true}"}, function (error, response, body) {console.log('Status:', response.statusCode);console.log('Headers:', JSON.stringify(response.headers));console.log('Response:', body);});
from urllib2 import Request, urlopenvalues = """{"email": "sally.cpa@smartvault.com","first_name": "sally","last_name": "cpa","account_name": "sallysfirm","email_validated": true}"""headers = {'Content-Type': 'application/json','Authorization': 'Basic dGVzdHVzZXJAc21hcnR2YXVsdC5jb206UTB4Sk1EQUFBQUFBQUFBQlVZRE9MOE82N3oyQjdvVmJLcytWMngybmZHTXgzR2FzY2pNUEp4Y0dGeHZPeWc9PQ==','Accept': 'application/json'}request = Request('https://rest.smartvault.com/auto/snew', data=values, headers=headers)response_body = urlopen(request).read()print response_body
<?php$ch = curl_init();curl_setopt($ch, CURLOPT_URL, "https://rest.smartvault.com/auto/snew");curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);curl_setopt($ch, CURLOPT_HEADER, FALSE);curl_setopt($ch, CURLOPT_POST, TRUE);curl_setopt($ch, CURLOPT_POSTFIELDS, "{\"email\": \"sally.cpa@smartvault.com\",\"first_name\": \"sally\",\"last_name\": \"cpa\",\"account_name\": \"sallysfirm\",\"email_validated\": true}");curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/json","Authorization: Basic dGVzdHVzZXJAc21hcnR2YXVsdC5jb206UTB4Sk1EQUFBQUFBQUFBQlVZRE9MOE82N3oyQjdvVmJLcytWMngybmZHTXgzR2FzY2pNUEp4Y0dGeHZPeWc9PQ==","Accept: application/json"));$response = curl_exec($ch);curl_close($ch);var_dump($response);
require 'rubygems' if RUBY_VERSION < '1.9'require 'rest_client'values = '{"email": "sally.cpa@smartvault.com","first_name": "sally","last_name": "cpa","account_name": "sallysfirm","email_validated": true}'headers = {:content_type => 'application/json',:authorization => 'Basic dGVzdHVzZXJAc21hcnR2YXVsdC5jb206UTB4Sk1EQUFBQUFBQUFBQlVZRE9MOE82N3oyQjdvVmJLcytWMngybmZHTXgzR2FzY2pNUEp4Y0dGeHZPeWc9PQ==',:accept => 'application/json'}response = RestClient.post 'https://rest.smartvault.com/auto/snew', values, headersputs response
package mainimport ("bytes""fmt""io/ioutil""net/http")func main() {client := &http.Client{}body := []byte("{\n \"email\": \"sally.cpa@smartvault.com\",\n \"first_name\": \"sally\",\n \"last_name\": \"cpa\",\n \"account_name\": \"sallysfirm\",\n \"email_validated\": true\n}")req, _ := http.NewRequest("POST", "https://rest.smartvault.com/auto/snew", bytes.NewBuffer(body))req.Header.Add("Content-Type", "application/json")req.Header.Add("Authorization", "Basic dGVzdHVzZXJAc21hcnR2YXVsdC5jb206UTB4Sk1EQUFBQUFBQUFBQlVZRE9MOE82N3oyQjdvVmJLcytWMngybmZHTXgzR2FzY2pNUEp4Y0dGeHZPeWc9PQ==")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))}
//Common testing requirement. If you are consuming an API in a sandbox/test region, uncomment this line of code ONLY for non production uses.//System.Net.ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };//Be sure to run "Install-Package Microsoft.Net.Http" from your nuget command line.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", "Basic dGVzdHVzZXJAc21hcnR2YXVsdC5jb206UTB4Sk1EQUFBQUFBQUFBQlVZRE9MOE82N3oyQjdvVmJLcytWMngybmZHTXgzR2FzY2pNUEp4Y0dGeHZPeWc9PQ==");httpClient.DefaultRequestHeaders.TryAddWithoutValidation("accept", "application/json");using (var content = new StringContent("{ \"email\": \"sally.cpa@smartvault.com\", \"first_name\": \"sally\", \"last_name\": \"cpa\", \"account_name\": \"sallysfirm\", \"email_validated\": true}", System.Text.Encoding.Default, "application/json")){using (var response = await httpClient.PostAsync("auto/snew", content)){string responseData = await response.Content.ReadAsStringAsync();}}}
Dim request = TryCast(System.Net.WebRequest.Create("https://rest.smartvault.com/auto/snew"), System.Net.HttpWebRequest)request.Method = "POST"request.ContentType = "application/json"request.Headers.Add("authorization", "Basic dGVzdHVzZXJAc21hcnR2YXVsdC5jb206UTB4Sk1EQUFBQUFBQUFBQlVZRE9MOE82N3oyQjdvVmJLcytWMngybmZHTXgzR2FzY2pNUEp4Y0dGeHZPeWc9PQ==")request.Accept = "application/json"Using writer = New System.IO.StreamWriter(request.GetRequestStream())Dim byteArray As Byte() = System.Text.Encoding.UTF8.GetBytes("{\""email\"": \""sally.cpa@smartvault.com\"",\""first_name\"": \""sally\"",\""last_name\"": \""cpa\"",\""account_name\"": \""sallysfirm\"",\""email_validated\"": true}")request.ContentLength = byteArray.Lengthwriter.Write(byteArray)writer.Close()End UsingDim responseContent As StringUsing response = TryCast(request.GetResponse(), System.Net.HttpWebResponse)Using reader = New System.IO.StreamReader(response.GetResponseStream())responseContent = reader.ReadToEnd()End UsingEnd Using
import groovyx.net.http.RESTClientimport static groovyx.net.http.ContentType.JSONimport groovy.json.JsonSlurperimport 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."Content-Type" = "application/json"emptyHeaders."Authorization" = "Basic dGVzdHVzZXJAc21hcnR2YXVsdC5jb206UTB4Sk1EQUFBQUFBQUFBQlVZRE9MOE82N3oyQjdvVmJLcytWMngybmZHTXgzR2FzY2pNUEp4Y0dGeHZPeWc9PQ=="emptyHeaders."Accept" = "application/json"def jsonObj = new JsonSlurper().parseText('{"email": "sally.cpa@smartvault.com","first_name": "sally","last_name": "cpa","account_name": "sallysfirm","email_validated": true}')response = client.post( path : "/auto/snew",body : jsonObj,headers: emptyHeaders,contentType : JSON )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/auto/snew"];NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:URL];[request setHTTPMethod:@"POST"];[request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];[request setValue:@"Basic dGVzdHVzZXJAc21hcnR2YXVsdC5jb206UTB4Sk1EQUFBQUFBQUFBQlVZRE9MOE82N3oyQjdvVmJLcytWMngybmZHTXgzR2FzY2pNUEp4Y0dGeHZPeWc9PQ==" forHTTPHeaderField:@"Authorization"];[request setValue:@"application/json" forHTTPHeaderField:@"Accept"];[request setHTTPBody:[@"{\n \"email\": \"sally.cpa@smartvault.com\",\n \"first_name\": \"sally\",\n \"last_name\": \"cpa\",\n \"account_name\": \"sallysfirm\",\n \"email_validated\": true\n}" dataUsingEncoding:NSUTF8StringEncoding]];NSURLSession *session = [NSURLSession sharedSession];NSURLSessionDataTask *task = [session dataTaskWithRequest:requestcompletionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {if (error) {// Handle 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// NOTE: Uncommment following two lines for use in a Playground// import PlaygroundSupport// PlaygroundPage.current.needsIndefiniteExecution = truelet url = URL(string: "https://rest.smartvault.com/auto/snew")!var request = URLRequest(url: url)request.httpMethod = "POST"request.addValue("application/json", forHTTPHeaderField: "Content-Type")request.addValue("Basic dGVzdHVzZXJAc21hcnR2YXVsdC5jb206UTB4Sk1EQUFBQUFBQUFBQlVZRE9MOE82N3oyQjdvVmJLcytWMngybmZHTXgzR2FzY2pNUEp4Y0dGeHZPeWc9PQ==", forHTTPHeaderField: "Authorization")request.addValue("application/json", forHTTPHeaderField: "Accept")request.httpBody = """"{\n \"email\": \"sally.cpa@smartvault.com\",\n \"first_name\": \"sally\",\n \"last_name\": \"cpa\",\n \"account_name\": \"sallysfirm\",\n \"email_validated\": true\n}"""".data(using: .utf8)let task = URLSession.shared.dataTask(with: request) { data, response, error inif 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()
Response
Returns the user_id, account_name and account_id of the newly created account.
Show success object
Returns an error object if the account name specified on the request body already exists.