REST API

Authorizing an Application

 
1. Log into http://beta.attribytes.com (credentials sent in separate email)
 
2. Navigate to your organization’s detail page by opening the side navigation panel (3 lines) and clicking on ‘List’ under ‘Organizations’
 
3. Add your Application:

  • Specify a name and select the scopes for the application.
    Once saved, the access token will be displayed on the application details page. Please use that token for all calls.
  • The scopes are the permission sets that the application has.  They will determine what the application can or cannot access.

4. Authorize your application:
View your newly created application’s details.
The details page has the application id, secret token, and callback URL, all of which you will need to successfully authorize your App.
Before you actually Authorize your application, you should ensure that your system is configured to handle the Authorization Code OAuth grant type.
Once your system has the appropriate information, hit Authorize.  This will send your system the authorization code.

To finish the Authorization process, your system will be expecting a POST to http://beta.attribytes.com/oauth/token with the following parameters:


"client_id=YOUR_APPLICATION_ID&client_secret=YOUR_SECRET_TOKEN&code=THE_AUTHORIZATION_CODE&grant_type=authorization_code&redirect_uri=YOUR_CALLBACK_URL"

 

The response to that POST will include your actual Authorization Token, which you should then store for use by your application.

API Usage 

The API will return JSON hashes for all actions by default.  Currently there are several functions.
Each request must be sent with the authorization token for the application making the request.

Add Products

   URL: http://beta.attribytes.com/apis/vmp_add
   METHOD: POST
This will process the JSON Hash that is sent in and one or many products.
The posted data must be in a JSON hash configured as follows:


products: [core: 
	{sku, gtin, manufacturer_product_number, product_description, extended_description,
	category, inner_pack_quantity, final_yield, manufacturer_description, manufacturer_description_extended,
	manufacturer, language, information_provider_gln, brand_owner_gln, label_type, target_market_subdivision_code,
	country_of_origin_1, country_of_origin_2, catch_weight, shelf_life, storage_temp_max,
	storage_temp_min, functional_name, global_product_classification, udex_classification,
	first_order_date, product_effective_date, discontinued_date, kosher, kosher_type_storage_type,
	unit_quantity, net_content, content_unit_of_measure, primary_unit_size, primary_unit_of_measure,
	master_case_pack, case_depth_unit_of_measure, case_height, case_width, case_volume, case_volume_unit_of_measure,
	net_weight, net_weight_unit_of_measure, gross_weight, pallet_hi, pallet_ti, case_packaging, ordering_unit_of_measure, 
	is_case_marked_with_batch_or_lot, is_case_returnable, is_case_marked_recyclable, is_case_base_unit,
	is_case_consumer_unit, is_case_dispatch_unit, is_case_invoice_unit, is_case_orderable_unit,
	is_non_sold_item_returnable, inner_gtin, pallet_quantity
	}]
 

For this simply pass in the GTIN you are interested in and you will receive the current information on that Trade Item.
Examples 
To actually send the data, simply insert the data into the appropriate field.
If you were just sending gtin, description, manufacturer_product_number, you would send this:


products: [{
 core:
   {
   gtin: "1234567890123", 
   description: “this is a test”, 
   manufacturer_product_number: "07810393"
  }
 }]
For Several Products just add a second hash to the array:
products: [
 {
 core:  {
  gtin: "1234567890123",
   description: “this is a tes”t, 
  manufacturer_product_number: "07810393"
  }
 },{
 core: {
  gtin: "7891011121314", 
  description: “second product”, 
  manufacturer_product_number: "78945611"
 }
 }
]

Add Images 

   URL: http://beta.attribytes.com/apis/vmp_add_images
   METHOD: POST


images: [{sku: "1234", url: "https://www.image.com/myimage", filename: "", file_type: ""}]  

Add Sales Data Customer

   URL: http://beta.attribytes.com/apis/add_sales_data_customers
   METHOD: POST


customers: [{customer_number, customer_name, address_info, contact_info, segment_name}]
segment name is a pipe separated list of your segments (Commercial | Fast Casual | BBQ | Small )

Add Sales Data

   URL: http://beta.attribytes.com/apis/add_sales_data
   METHOD: POST


sales: [{start_date, end_date, division_name, business_unit, vend_id, cust_id, prod_id, special_order_item, sales_dollars, sales_cases, true_cost, financial_cost, total_exclusions, total_deviations, prod_internal_devs, frt_internal_devs, off_invoice_disc, internal_cbu, rebates: [rebate]}]]  

Add Vendor Relationships 

   URL: http://beta.attribytes.com/apis/add_vendor_relationships
   METHOD: POST


Relationships: [{parent_vendor_id, child_vendor_id}] => Tyson (1234), Chicken House (2345)

Add Purchasing Data

   URL: http://beta.attribytes.com/apis/add_purchasing_data
   METHOD: POST


purchases: [{distributor_name, start_date, end_date, distributor_location, business_unit, vend_id, vend_gln, vend_org_name, vend_name_id, vend_name, proprietary, spec_ord, prod_id, prod_sku, purchases_dollars, purchases_cases, purchase_lbs, vendor_status}]