Skip to main content
Cartegraph Campus

Files for REST API

This feature may not be available in every package. Not sure if you have this feature or you want to learn more about it? Send us a message at support@cartegraph.com. 

Cartegraph's API is a licensed product that requires a purchase and verified ownership before production use.

  • Purpose: Allows a client to send and retrieve file based data from the imp-exp formats folder in project home.
  • Introduced: v8 - Summer 2015
  • HTTP Methods: GET, POST, PUT
  • URL:
    • https://yourserver.com/cartegraph/api/v1/files/importexport/{filename}
  • URL Parameters:
    • filename - File location and name (examples: Data.txt, OR Signs/Signs.json)

Example Requests

Get a file called test.csv from imp-exp formats folder in project home.

GET https://yourserver.com/cartegraph/api/v1/files/importexport/test.csv

Get a file called Signs.json from 'imp-exp formats/Signs' folder in project home.

GET https://yourserver.com/cartegraph/api/v1/files/importexport/Signs/Signs.json

Status Codes Returned and Common Error Messages

  • 200 OK
    • The message body contains the data in the test.csv file.
  • 403 Forbidden
    • Could not access the requested directory location or file
  • 404 Not Found
    • Could not find the directory location or file requested

Post a file called test.csv to the imp-exp formats folder in project home. POST will not overwrite a file if it already exist.

POST https://yourserver.com/cartegraph/api/v1/files/importexport/test.csv

Post a file called Signs.json to the 'imp-exp formats/Signs' folder in project home. POST will not overwrite a file if it already exist.

POST https://yourserver.com/cartegraph/api/v1/files/importexport/Signs/Signs.json

Status Codes Returned and Common Error Messages

  • 200 OK
  • The message body contains success:true and filename:[name of the file posted].
  • 400 Bad Request
    • Uploaded file already exists.
    • The file to upload could not be found
  • 403 Forbidden
    • Could not access the upload file directory location or file

Put a file called test.csv to the imp-exp formats folder in project home. PUT will not add a the file if it doesn't exist.

PUT https://yourserver.com/cartegraph/api/v1/files/importexport/test.csv

Put a file called Signs.json to the 'imp-exp formats/Signs' folder in project home. PUT will not add a the file if it doesn't exist.

PUT https://yourserver.com/cartegraph/api/v1/files/importexport/Signs/Signs.json

Status Codes Returned and Common Error Messages:

  • 200 OK
    • The message body contains success:true and filename:[name of the file posted].
  • 400 Bad Request
    • Uploaded file already exists.
    • The file to upload could not be found
  • 403 Forbidden
    • Could not access the upload file directory location or file
  • 404 Not Found
    • Could not find the file you are requesting.