An Account allows a user to manage Products from LRS.

Some facts about accounts in LRS Connect are:

  • Accounts owned by an Administrative user.
  • Other types of users are Managers and Reporting users.
  • A user may be an Administrator, Manager or Reporting user on one more more accounts.

Account Attributes

NameDescriptionDetails
accountGuidUnique identifier for an account.
companyNameThe company name for the account.
countryCodeThe country associated with the account.

/rest/v3/accounts

Retrieves a list of accounts that are authorized for the user.

Request

// Report Controller accounts (GET https://connect.lrsus.com/rest/v3/accounts)

$.ajax({
    url: "https://connect.lrsus.com/rest/v3/accounts",
    type: "GET",
    headers: {
        "Authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE0MzU3ODAwMjksInN1YiI6IlY5MjhaNENSV1hUM1oxWlFJNzRUSk5UUFgiLCJpc3MiOiJodHRwczovL2FwaS5zdG9ybXBhdGguY29tL3YxL2FwcGxpY2F0aW9ucy81c3VtdGdod3A2Vkw2cUdTbUN3VDJjIiwiaWF0IjoxNDM1Nzc4ODI5fQ.HImt7h2ML-gNsphXIxRIlIv9IV8uLuOuSx8QKyezeA0",
    },
})
.done(function(data, textStatus, jqXHR) {
    console.log("HTTP Request Succeeded: " + jqXHR.status);
    console.log(data);
})
.fail(function(jqXHR, textStatus, errorThrown) {
    console.log("HTTP Request Failed");
})
.always(function() {
    /* ... */
});
import java.io.IOException;
import org.apache.http.client.fluent.*;

public class SendRequest
{
  public static void main(String[] args) {
    sendRequest();
  }
  
  private static void sendRequest() {
    
    // Report Controller accounts (GET )
    
    try {
      
      // Create request
      Content content = Request.Get("https://connect.lrsus.com/rest/v3/accounts")
      
      // Add headers
      .addHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE0MzU3ODAwMjksInN1YiI6IlY5MjhaNENSV1hUM1oxWlFJNzRUSk5UUFgiLCJpc3MiOiJodHRwczovL2FwaS5zdG9ybXBhdGguY29tL3YxL2FwcGxpY2F0aW9ucy81c3VtdGdod3A2Vkw2cUdTbUN3VDJjIiwiaWF0IjoxNDM1Nzc4ODI5fQ.HImt7h2ML-gNsphXIxRIlIv9IV8uLuOuSx8QKyezeA0")
      
      // Fetch request and return content
      .execute().returnContent();
      
      // Print content
      System.out.println(content);
    }
    catch (IOException e) { System.out.println(e); }
  }
}
// Report Controller accounts (GET https://connect.lrsus.com/rest/v3/accounts)

NSURL* URL = [NSURL URLWithString:@"https://connect.lrsus.com/rest/v3/accounts"];
NSMutableURLRequest* request = [NSMutableURLRequest requestWithURL:URL];
request.HTTPMethod = @"GET";

// Headers

[request addValue:@"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE0MzU3ODAwMjksInN1YiI6IlY5MjhaNENSV1hUM1oxWlFJNzRUSk5UUFgiLCJpc3MiOiJodHRwczovL2FwaS5zdG9ybXBhdGguY29tL3YxL2FwcGxpY2F0aW9ucy81c3VtdGdod3A2Vkw2cUdTbUN3VDJjIiwiaWF0IjoxNDM1Nzc4ODI5fQ.HImt7h2ML-gNsphXIxRIlIv9IV8uLuOuSx8QKyezeA0" forHTTPHeaderField:@"Authorization"];

// Connection

NSURLConnection* connection = [NSURLConnection connectionWithRequest:request delegate:nil];
[connection start];
curl -X "GET" "https://connect.lrsus.com/rest/v3/accounts" \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE0MzU3ODAwMjksInN1YiI6IlY5MjhaNENSV1hUM1oxWlFJNzRUSk5UUFgiLCJpc3MiOiJodHRwczovL2FwaS5zdG9ybXBhdGguY29tL3YxL2FwcGxpY2F0aW9ucy81c3VtdGdod3A2Vkw2cUdTbUN3VDJjIiwiaWF0IjoxNDM1Nzc4ODI5fQ.HImt7h2ML-gNsphXIxRIlIv9IV8uLuOuSx8QKyezeA0"
# Install the Python Requests library:
# `pip install requests`

import requests

def send_request():
    # Report Controller accounts (GET https://connect.lrsus.com/rest/v3/accounts)

    try:
        r = requests.get(
            url="https://connect.lrsus.com/rest/v3/accounts",
            headers = {
                "Authorization":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE0MzU3ODAwMjksInN1YiI6IlY5MjhaNENSV1hUM1oxWlFJNzRUSk5UUFgiLCJpc3MiOiJodHRwczovL2FwaS5zdG9ybXBhdGguY29tL3YxL2FwcGxpY2F0aW9ucy81c3VtdGdod3A2Vkw2cUdTbUN3VDJjIiwiaWF0IjoxNDM1Nzc4ODI5fQ.HImt7h2ML-gNsphXIxRIlIv9IV8uLuOuSx8QKyezeA0",
            },
        )
        print('Response HTTP Status Code   : {status_code}'.format(status_code=r.status_code))
        print('Response HTTP Response Body : {content}'.format(content=r.content))
    except requests.exceptions.RequestException as e:
        print('HTTP Request failed')

Response 200 (application/json)

{
          "status": 200,
          "count": "25",
          "offset" : 50,
          "limit" : 25,
          "first" : "https://connect.lrsus.com/rest/v3/accounts?offset=0&limit=25",
          "previous" : "https://connect.lrsus.com/rest/v3/accounts?offset=25&limit=25",
          "next" : "https://connect.lrsus.com/rest/v3/accounts?offset=75&limit=25",
          "last" : "https://connect.lrsus.com/rest/v3/accounts?offset=8745&limit=25",
          "items": [
            {
              "accountGuid": "777a5eb-59ea-4003-9c1c-77760879c88d",
              "companyName": "Bob's Deli",
              "countryCode": "US"
            },
            ...
            {
              "accountGuid": "888a5eb-59ea-4003-9c1c-77760879c88d",
              "companyName": "Chimera Bread",
              "countryCode": "US"
            }
          ]
}

/rest/v3/accounts/{accountGuid}

Retrieves details for a particular account identified by its guid.

NameDescriptionDetails
accountGuidUnique identifier for an account

Request

// Report Controller accounts (GET https://connect.lrsus.com/rest/v3/accounts/7c088e00-edeb-43b6-9303-872e0385d598)

$.ajax({
    url: "https://connect.lrsus.com/rest/v3/accounts/7c088e00-edeb-43b6-9303-872e0385d598",
    type: "GET",
    headers: {
        "Authorization": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE0MzU3ODAwMjksInN1YiI6IlY5MjhaNENSV1hUM1oxWlFJNzRUSk5UUFgiLCJpc3MiOiJodHRwczovL2FwaS5zdG9ybXBhdGguY29tL3YxL2FwcGxpY2F0aW9ucy81c3VtdGdod3A2Vkw2cUdTbUN3VDJjIiwiaWF0IjoxNDM1Nzc4ODI5fQ.HImt7h2ML-gNsphXIxRIlIv9IV8uLuOuSx8QKyezeA0",
    },
})
.done(function(data, textStatus, jqXHR) {
    console.log("HTTP Request Succeeded: " + jqXHR.status);
    console.log(data);
})
.fail(function(jqXHR, textStatus, errorThrown) {
    console.log("HTTP Request Failed");
})
.always(function() {
    /* ... */
});
import java.io.IOException;
import org.apache.http.client.fluent.*;

public class SendRequest
{
  public static void main(String[] args) {
    sendRequest();
  }
  
  private static void sendRequest() {
    
    // Report Controller accounts (GET )
    
    try {
      
      // Create request
      Content content = Request.Get("https://connect.lrsus.com/rest/v3/accounts/7c088e00-edeb-43b6-9303-872e0385d598")
      
      // Add headers
      .addHeader("Authorization", "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE0MzU3ODAwMjksInN1YiI6IlY5MjhaNENSV1hUM1oxWlFJNzRUSk5UUFgiLCJpc3MiOiJodHRwczovL2FwaS5zdG9ybXBhdGguY29tL3YxL2FwcGxpY2F0aW9ucy81c3VtdGdod3A2Vkw2cUdTbUN3VDJjIiwiaWF0IjoxNDM1Nzc4ODI5fQ.HImt7h2ML-gNsphXIxRIlIv9IV8uLuOuSx8QKyezeA0")
      
      // Fetch request and return content
      .execute().returnContent();
      
      // Print content
      System.out.println(content);
    }
    catch (IOException e) { System.out.println(e); }
  }
}
// Report Controller accounts (GET https://connect.lrsus.com/rest/v3/accounts/7c088e00-edeb-43b6-9303-872e0385d598)

NSURL* URL = [NSURL URLWithString:@"https://connect.lrsus.com/rest/v3/accounts/7c088e00-edeb-43b6-9303-872e0385d598"];
NSMutableURLRequest* request = [NSMutableURLRequest requestWithURL:URL];
request.HTTPMethod = @"GET";

// Headers

[request addValue:@"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE0MzU3ODAwMjksInN1YiI6IlY5MjhaNENSV1hUM1oxWlFJNzRUSk5UUFgiLCJpc3MiOiJodHRwczovL2FwaS5zdG9ybXBhdGguY29tL3YxL2FwcGxpY2F0aW9ucy81c3VtdGdod3A2Vkw2cUdTbUN3VDJjIiwiaWF0IjoxNDM1Nzc4ODI5fQ.HImt7h2ML-gNsphXIxRIlIv9IV8uLuOuSx8QKyezeA0" forHTTPHeaderField:@"Authorization"];

// Connection

NSURLConnection* connection = [NSURLConnection connectionWithRequest:request delegate:nil];
[connection start];
curl -X "GET" "https://connect.lrsus.com/rest/v3/accounts/7c088e00-edeb-43b6-9303-872e0385d598" \
	-H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE0MzU3ODAwMjksInN1YiI6IlY5MjhaNENSV1hUM1oxWlFJNzRUSk5UUFgiLCJpc3MiOiJodHRwczovL2FwaS5zdG9ybXBhdGguY29tL3YxL2FwcGxpY2F0aW9ucy81c3VtdGdod3A2Vkw2cUdTbUN3VDJjIiwiaWF0IjoxNDM1Nzc4ODI5fQ.HImt7h2ML-gNsphXIxRIlIv9IV8uLuOuSx8QKyezeA0"
# Install the Python Requests library:
# `pip install requests`

import requests

def send_request():
    # Report Controller accounts (GET https://connect.lrsus.com/rest/v3/accounts/7c088e00-edeb-43b6-9303-872e0385d598)

    try:
        r = requests.get(
            url="https://connect.lrsus.com/rest/v3/accounts/7c088e00-edeb-43b6-9303-872e0385d598",
            headers = {
                "Authorization":"Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE0MzU3ODAwMjksInN1YiI6IlY5MjhaNENSV1hUM1oxWlFJNzRUSk5UUFgiLCJpc3MiOiJodHRwczovL2FwaS5zdG9ybXBhdGguY29tL3YxL2FwcGxpY2F0aW9ucy81c3VtdGdod3A2Vkw2cUdTbUN3VDJjIiwiaWF0IjoxNDM1Nzc4ODI5fQ.HImt7h2ML-gNsphXIxRIlIv9IV8uLuOuSx8QKyezeA0",
            },
        )
        print('Response HTTP Status Code   : {status_code}'.format(status_code=r.status_code))
        print('Response HTTP Response Body : {content}'.format(content=r.content))
    except requests.exceptions.RequestException as e:
        print('HTTP Request failed')

Response 200 (application/json)

{
          "status": 200,
          "account":
            {
              "accountGuid": "777a5eb-59ea-4003-9c1c-77760879c88d",
              "companyName": "Jason's Deli",
              "countryCode": "US"
            }
}