Documenting: bettertravaux.ovh API

Endpoints

/tasks

  • URL
    • https://api.bettertravaux.ovh/tasks
  • Methods
    • GET
  • URL Params
    • “start” – optional
      • Format: “YYYY-MM-DD”
      • Can be abbreviated (e.g. “YYYY-MM”)
    • “end” – optional
      • Format: “YYYY-MM-DD”
      • Can be abbreviated (e.g. “YYYY-MM”)
  • Success Response
    • 200
    • Content
      • List of task IDs
  • Error Response
    • 404 NOT FOUND
      • Content
        • None
      • Reason
        • No results found
    • 400 BAD REQUEST
      • Reason
        • check the date format
        • malformed URL
  • Sample calls

Call:

curl "https://api.bettertravaux.ovh/tasks"

Result:

[
121,
122,
123,
124,
125,
126,
127,
...
]

Call

curl "https://api.bettertravaux.ovh/tasks?start=2017-05-11&end=2017-05-12"

Response

[
    24685,
    24687,
    24688,
    24689,
    24690
]

Call

curl "https://api.bettertravaux.ovh/tasks?start=2017-05-11&end=2017-05-11"

Response

404 NOT FOUND

  •  Notes
    • The result is huge. You may want to set boundaries using “start” and “end”.

/task/:taskid:

  • URL
    • https://api.bettertravaux.ovh/task/:task:id
  • Methods
    • GET
  • Success Response
    • 200
    • Content
      • JSON response containing task and comments
  • Sample calls

Call:

curl "https://api.bettertravaux.ovh/task/28247"

Result:

{
    "Task": {
        "Id": 28206,
        "Title": "Additional disk cluster GRA1",
        "Project_id": 18,
        "Category": "cloud",
        "Closed_at": "2017-11-13 12:28:00",
        "Closed_reason": "Done\r",
        "Closed_additional": "",
        "Task_type": "Maintenance",
        "Status": "CLOSED",
        "Status_num": 100,
        "Content": "• intervention summary - Résumé de l'intervention: PG increasing on GRA1 \n• Start time - Heure de début: 2017-11-07 22:00:00 CET\n• Impact - Périmètre affecté: Public Cloud \n• Impact type / Type d'impact: Lowered performances",
        "Added_to_db": "2017-11-07 13:34:31"
    },
    "Comments": [
        {
            "CommentId": 35101,
            "Author": "OVH",
            "CommentTimestamp": "2017-11-08 09:58:00",
            "Comment": "20% of rebalance done."
        },
        {
            "CommentId": 35114,
            "Author": "OVH",
            "CommentTimestamp": "2017-11-08 17:21:00",
            "Comment": "30% of rebalance done."
        },
        {
            "CommentId": 35177,
            "Author": "OVH",
            "CommentTimestamp": "2017-11-09 14:43:00",
            "Comment": "70% of rebalance done"
        },
        {
            "CommentId": 35247,
            "Author": "OVH",
            "CommentTimestamp": "2017-11-10 06:12:00",
            "Comment": "90% of rebalance done"
        },
        {
            "CommentId": 35294,
            "Author": "OVH",
            "CommentTimestamp": "2017-11-13 12:28:00",
            "Comment": "Completed."
        }
    ]
}

/service/:service:

  • URL
    • https://api.bettertravaux.ovh/service/:service:
  • Methods
    • GET
  • Success Response
    • 200
    • Content
      • JSON response containing task IDs
  • Error Response
    • 404 NOT FOUND
      • Content
        • None
      • Reason
        • Search does not match any item
  • Sample calls

Call

curl "https://api.bettertravaux.ovh/service/pcc-005412"

Response

[
    18013
]

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.