Text notes


Introduction

With Navigart 3 API, [authenticated users](public_and_private_publications.html#authentication](authenticated users) can create carts, add artworks to carts and print them. You need to be authenticated on a publication to have access to carts, even if you are on a public publication.

Informations about one cart

When you are authenticated on a public (or a private) publication, you can have access to carts : curl -H 'X-Token: ...' 'https://api.navigart.fr/39/carts' | jq '.'

[
   {
     "id": 776,
     "vault": "39",
     "name": "Nouveau dossier de sélection",
     "artwork_ids": [],
     "user_id": 131,
     "primary": true,
     "created_at": "2017-07-20T14:33:03.000Z",
     "updated_at": "2017-12-23T06:23:01.000Z",
     "parent_id": null,
     "user_email": "yourEmail",
     "text_note": null,
     "collaborators": []
  }
]

A empty cart is created when user creates his account. Then you can add a artwork to the cart : curl -H 'X-Token: ...' -X POST -d '{}' 'https://api.navigart.fr/39/carts/776/add_artwork?artwork_id=210000000000501' Where : * 39 is the publication vault * 776 is the cart id you have seen before * 210000000000501 is the artwork id you want to add to the cart

The response of this query is an JSON object of the updated cart :

[
   {
     "id": 776,
     "vault": "39",
     "name": "Nouveau dossier de sélection",
     "artwork_ids": [
        "210000000000501"
     ],
     "user_id": 131,
     "primary": true,
     "created_at": "2017-07-20T14:33:03.000Z",
     "updated_at": "2017-12-23T06:23:01.000Z",
     "parent_id": null,
     "user_email": "yourEmail",
     "text_note": null,
     "collaborators": []
  }
]

You can also remove an artwork from this cart : curl -H 'X-Token: ...' -X POST -d '{}' 'https://api.navigart.fr/39/carts/776/add_artwork?artwork_id=210000000000501' Where :

The response of this query is an JSON object of the updated cart :

[
   {
     "id": 776,
     "vault": "39",
     "name": "Nouveau dossier de sélection",
     "artwork_ids": [],
     "user_id": 131,
     "primary": true,
     "created_at": "2017-07-20T14:33:03.000Z",
     "updated_at": "2017-12-23T06:23:01.000Z",
     "parent_id": null,
     "user_email": "yourEmail",
     "text_note": null,
     "collaborators": []
  }
]

You can see a specific cart : curl -H 'X-Token: ...' 'https://api.navigart.fr/39/artworks?cart_id=776' Please note that you have to query artworks endpoint, not carts endpoint. So :

Adding and removing carts

To add a new cart, just post the name of this new cart : curl -H "Content-Type: application/json" -X POST -d '{"name":"new_name"}' -H 'X-Token: ...' 'https://api.navigart.fr/39/carts' The response is the new cart :

[
   {
     "id": 777,
     "vault": "39",
     "name": "new_name",
     "artwork_ids": [],
     "user_id": 131,
     "primary": true,
     "created_at": "2017-07-20T14:33:03.000Z",
     "updated_at": "2017-12-23T06:23:01.000Z",
     "parent_id": null,
     "user_email": "yourEmail",
     "text_note": null,
     "collaborators": []
  }
]

You also can remove the cart : curl -X DELETE -H 'X-Token: ...' 'https://api.navigart.fr/39/carts/777'

Or maybe, you prefer to rename it : curl -H "Content-Type: application/json" -X PUT -d '{"name":"my_better_name"}' -H 'X-Token: ...' 'https://api.navigart.fr/39/carts/777'

Contact us

You may contact us by sending an email to aide@videomuseum.fr