Announcement

Collapse
No announcement yet.

API and Curl

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    API and Curl

    Not sure if this is the correct area to post but I am having issue with getting past 401 Authentication using Curl with the API.

    So these are the steps I did:

    1) Created new API token: https://(my store url)/mm5/json.mvc, Allowed IP address: 0.0.0.0/0, ::/0, No signature or timestamp
    2) Functions assigned to token: OrderList_Load_Query, ProductList_Load_Query, Time_UTC
    3) Under User management->Groups .. my user id is assigned to all groups and all groups have the API token assigned to it.
    4) Different Curls I did:
    a) curl -X POST "[My Store Name]/mm5/json.mvc" -H "Content-Type: application/json" -H "Authorization: Bearer [My API Token]" -d '{"Store_Code": "[My Store Code]",\ "Function": "Time_UTC"}'
    b) curl -X POST "[My Store Name]/mm5/json.mvc" -H "Content-Type: application/json" -H "Authorization: Bearer [My API Token]" -d '{"Store_Code":"[My Store Code]","Function":"ProductList_Load_Query"}'
    c) curl -X POST "[My Store Name]/mm5/json.mvc" -H "Content-Type: application/json" -H "Authorization: Bearer [My API Token]" -d "{"Store_Code": "PTS", "Function": "OrderList_Load_Query", "Filters": [{"field": "order_id", "operator": "=", "value": "1018"}]}"
    5) have done a bunch of variations with products and orders in retrieving .. keep always getting a 401 Auth error.

    Any help will be appreciated.

    #2
    mbajadek Have you used the Miva JSON API Postman Collection & Environment: https://www.postman.com/mivamerchant

    The Miva: JSON API: Authenticated Collection offers an authenticated way of making API calls to your store. It will also give you the correct CURL code for the call.

    Feel free to reach out to [email protected] with further questions or issues connecting to the JSON API.
    Nicholas Adkins
    Technical Training Specialist / Miva, Inc.
    [email protected]
    https://www.miva.com/mivalearn

    Comment


      #3
      Haven't seen that .. thank you so much !!!!

      Comment

      Working...
      X