API Newbie Questions

I am trying to get started to build my first implementation using veeqo APIs. I have done very little with APIs, and am having a difficult time getting started using the veeqo API document at API Docs - Veeqo Developers

My first project is to download the inventory file in order to obtain the current inventory for every SKU in veeqo.

I do have my API key.

I understand that (and please correct me if I am wrong throughout this message) since this project is for internal use only, that I can use API Keys authentication.

The sample shows:

curl --request GET \
  --url https://api.veeqo.com/orders \
  --header 'accept: application/json' \
  --header 'x-api-key: YOUR API KEY HERE'

Question 1: For my inventory project do I still use the orders folder? If not, what folder should I be using?

Question 2: Do I need to include any code before the Curl for processing json? if so what is the code

Question 3: Is the curl code PHP code?

Question 4: To use this code in PHP; would the PHP code be:

<?php `curl --request GET \` ` --url https://api.veeqo.com/orders \ ` ` --header 'accept: application/json' \ ` ` --header 'x-api-key: YOUR API KEY HERE'` Question 5: Don't I need an ending ";"? Question 6: How do I check to see if the curl failed or completed successfully? Question 7: How do I obtain the failure reason in order to display it? Question 8: I understand the limits discussion, but how do I monitor and throttle the throughput in order to stay within the limits? Under Code Samples: Question 9: I am not familiar with GitHub. How do I get to the Veeqo API GitHub page? Under Dashboard: Question 10: The link in "The live example can be [found here.](https://veeqo-dashboard.herokuapp.com/)" results in an image indicating that there are no examples??? Thank you in advance.

Hey there @greeneware,

If you’re looking to retrieve data about inventory, you should target the /products endpoint instead of /orders. You can learn more about the various product related methods here: API Docs - Veeqo Developers

You may want to have a look at the cURL library for PHP to make HTTP requests from PHP to the Veeqo API.

You can find the Veeqo API GitHub page here: VeeqoAPI · GitHub.

Thank you for that information; it helped me a lot.

I am now experimenting with config, fetch-products, and index.

You can see the results at: https://greeneware.com/veeqo/examples/index.php

Please provide the corrected information for the following:

$product[‘sku_code’] should be?
$product[‘available_stock_level’] should be?
$product[‘price’] should be?

Thank you for helping me to understand the product layout.

I am now experimenting with the same code files config, fetch-products, and index.

You can see the results at: https://greeneware.com/veeqo/examples/index.php

The following code appears in fetch-products:

curl_setopt($ch, CURLOPT_URL, “https://api.veeqo.com/products?page_size=25&page=1”);

I Interpret this to mean:
a) Process 25 products
b) Process 1 page

Question 1: I f this is not correct, please correct me.

Question 2: If I want to process 50 products do I:
a) Use the code in fetch_products where page_size=50&page=1

  • OR -
    b) go through fetch-products twice where:
  1. The 1st time use: page_size=25&page=1
  2. The 2nd time use:page_size=25&page=2

c) Or, please describe if there is a different process

Question 3: If I am working my way through the products, how do I know how many pages of size 25 I will have to process?

Question 4: The last page is not likely to contain 25 products. How to I retrieve the final products?

Thank you for helping me to understand how this process works.

Either approach is fine. For your use case it would probably make more sense to request all 50 products in one go.

The response contains an X-Total-Pages-Count header which contains the total number of pages of products. You can use this number to request the final page of products.