build your own api reference

This is a more advanced level of integration of Build Your Own, which is intended for resellers keeping stock, with a fully developed solution for e-commerce, only. This requires a direct connection to your own order system and involves more of an investment in terms of time and resources. If you would like to know more about this, please contact anders@stringfurniture.com

API Endpoint

https://api.stringfurniture.com/v4/byo/

GUID

GUID: sit_1234567890abcdef

API Reference

The StringBYO API is organized around REST. Our API is designed to have predictable, resource-oriented URLs and to use HTTP response codes to indicate API errors. JSON will be returned in all responses from the API.

Set datatype to json and add accept = application/json to the headers in the request

Authentication

All requests are authenticated by sending the store guid in the header.

A sample request

Using jQuery and javascript

        $.ajax({
          type: 'POST',
          dataType: 'json',
          url: 'https://api.stringfurniture.com/v4/byo/token',
          headers: {
            'guid':'sit_1234567890abcdef',
            accept: application/json
          },
          success: function(response) {
            token = response.token; // use this token when loading Build Your own.
          }
        });
      

All API requests must be made over HTTPS. Calls made over plain HTTP will fail.

Methods

Session

The API allows you to create a token. The token can be passed into a embedded BYO page as an identifier.

The token object

Attributes
token
string
-

Sample Response

      {
        "token" :  "tok_6Ry87987hVC"
      }
      

POST a token

Creates a new token object.

Arguments
Takes no arguments -
Returns

Returns a token object if the call succeeded.

Definition

Example Request

api/v2/token

Design object

The API allows you to retrieve designs from the embedded BYO identified by a token.

The design object

Attributes
object
string, value is "designset"
-
id
string
design version id for design on stage
created
string
design first created
type
string
system or plex
shelves
list
list of shelves for design on stage
 Child objects
  articlename
string
string article id
  eancode
string
-
  count
integer
no of items in design
  unusedcount
integer
-
  packsize
integer
-
panels
list
list of panels for design on stage
 Child objects
  articlename
string
string article id
  eancode
string
-
  count
integer
-

Sample Response

{
        "object" :  "designset",
"id" : v8240130,
"created" : "2015-07-19",
"type" : "system",
"shelves" : [ { "articlename" : "7830-12-3", "eancode" : "7350038270276", "count" : 3, "unusedcount" : 1, "packsize" : 3 }, { "articleid" : "7830-13-3", "eancode" : "7350038270283", "count" : 1, "unusedcount" : 0, "packsize" : 3 } ], "panels" : [ { "articlename" : "SF20030-12-1", "eancode" : "7350038270429", "count" : 3 } ] }

GET a designobject

Retrieves the designs in an embedded BYO. You need only supply the token.

Arguments
token
required
-
Returns

Returns a designset object if the call succeeded.

Definition

Sample Request

api/v2/designobject/token_4WZr9GdoRXdhVjM339abba
      

Embed Build Your Own

Build Your Own can be embedded in an iframe.

The URL for Build Your Own is https://build-your-own.stringfurniture.com

For the best result the iframe should be set with scrolling="no" and the following CSS styling.

  • width: 980px;
  • height: 780px;
  • border: none;
  • overflow: hidden;

Build Your Own takes the following arguments. All are optional.

argumentdescriptionsample valuedefault
lanLanguage used in Build Your Own user interface.See side for list of available languages.2
countrycode2 letter ISO code for country or AUTO. When set to a specific country BYO will not ask user for geolocation.SEAUTO
systemDefault string product group loaded in Build Your Own.1 = string system, 2 = string plex1
tokenToken returned from the API. Use this to enable the API to retrieve data from the embedded Build Your Own.tok_6Ry87987hVC-
guidStore GUID. When this is provided, new customers will be members of the store.sit_1234567890abcdef-
designtemplateDesign id for a standard design. Build Your Own will be loaded with this design.Contact string for a list of design template ids.-
  • 1 = swedish
  • 2 = english
  • 3 = japanese
  • 4 = german