# API Newbie Questions

**URL:** <https://developer-forum.veeqo.com/t/api-newbie-questions/819>\
**Category:** API Queries (How To)\
**Created:** [November 3, 2023, 5:00pm UTC](https://developer-forum.veeqo.com/t/api-newbie-questions/819 "2023-11-03T17:00:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![greeneware](https://avatars.discourse-cdn.com/v4/letter/g/36C2B4/32.png) [@greeneware](https://developer-forum.veeqo.com/u/greeneware)\
**Post date:** [November 3, 2023, 5:00pm UTC](https://developer-forum.veeqo.com/t/api-newbie-questions/819/1 "2023-11-03T17:00:51Z")

</div>

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](https://developer.veeqo.com/docs#/introduction/developer-central)

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:

```auto
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.

---

<div class="post-metadata">

**Author:** ![fullsam](https://avatars.discourse-cdn.com/v4/letter/f/232F3E/32.png) [@fullsam](https://developer-forum.veeqo.com/u/fullsam)\
**Post date:** [November 13, 2023, 4:28pm UTC](https://developer-forum.veeqo.com/t/api-newbie-questions/819/2 "2023-11-13T16:28:45Z")

</div>

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](https://developer.veeqo.com/docs#/reference/products/product-collection/list-all-products)

You may want to have a look at the [cURL library for PHP](https://www.php.net/manual/en/book.curl.php) to make HTTP requests from PHP to the Veeqo API.

You can find the Veeqo API GitHub page here: [VeeqoAPI · GitHub](https://github.com/veeqoapi).

---

<div class="post-metadata">

**Author:** ![greeneware](https://avatars.discourse-cdn.com/v4/letter/g/36C2B4/32.png) [@greeneware](https://developer-forum.veeqo.com/u/greeneware)\
**Post date:** [November 24, 2023, 7:00pm UTC](https://developer-forum.veeqo.com/t/api-newbie-questions/819/3 "2023-11-24T19:00:43Z")

</div>

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](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.

---

<div class="post-metadata">

**Author:** ![greeneware](https://avatars.discourse-cdn.com/v4/letter/g/36C2B4/32.png) [@greeneware](https://developer-forum.veeqo.com/u/greeneware)\
**Post date:** [November 27, 2023, 6:21am UTC](https://developer-forum.veeqo.com/t/api-newbie-questions/819/4 "2023-11-27T06:21:07Z")

</div>

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](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](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.

---

<div class="post-metadata">

**Author:** ![fullsam](https://avatars.discourse-cdn.com/v4/letter/f/232F3E/32.png) [@fullsam](https://developer-forum.veeqo.com/u/fullsam)\
**Post date:** [November 28, 2023, 6:07pm UTC](https://developer-forum.veeqo.com/t/api-newbie-questions/819/5 "2023-11-28T18:07:08Z")

</div>

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.
