Choose your language:
    Retrieve a deploy event
    Returns
    Returns a build_event object.

    Examples

    Example code:
    const { SiteClient } = require('datocms-client');
    async function run() {
    const client = new SiteClient('YOUR-API-TOKEN');
    const buildEventId = '34';
    const buildEvent = await client.buildEvent.find(buildEventId);
    console.log(buildEvent);
    }
    run();
    Returned output:
    > node example.js
    {
    "id": "34",
    "eventType": "response_success",
    "createdAt": "2016-09-20T18:50:24.914Z",
    "data": {
    "requestBody": "{\"object_kind\":\"build\",\"ref\":\"master\",\"tag\":false,\"before_sha\":\"0000000000000000000000000000000000000000\",\"sha\":\"ecfccf5ea28af900c14b499a2b762e029c7492\",\"build_id\":10495,\"build_name\":\"build\",\"build_stage\":\"test\",\"build_status\":\"success\",\"build_started_at\":\"2016-09-20 18:49:22 UTC\",\"build_finished_at\":\"2016-09-20 18:50:24 UTC\",\"build_duration\":62.279854524,\"build_allow_failure\":false,\"project_id\":195,\"project_id\":\"Stefano Verna / awesome-website\",\"user\":{\"id\":null,\"name\":null,\"email\":null},\"commit\":{\"id\":6754,\"sha\":\"ecfccf5ea28af900c6614b499a2b762e029c7492\",\"message\":\"Update gems\\n\",\"author_name\":\"Stefano Verna\",\"author_email\":\"s.verna@datocms.com\",\"status\":\"success\",\"duration\":62,\"started_at\":\"2016-09-20 18:49:22 UTC\",\"finished_at\":\"2016-09-20 18:50:24 UTC\"},\"repository\":{\"name\":\"awesome-website\",\"url\":\"git@gitlab.com:stefanoverna/awesome-website.git\",\"description\":\"\",\"visibility_level\":0}}",
    "requestHeaders": {
    "via": "1.1 vegur",
    "host": "webhooks.datocms.com",
    "origin": null,
    "version": "HTTP/1.1",
    "connection": "close",
    "connectTime": "0",
    "xRequestId": "5c1beced-0fe3-4c5b-b45d-68ba4a15b5f3",
    "xGitlabEvent": "Build Hook",
    "xForwardedFor": "46.101.135.219",
    "xRequestStart": "1474397424903",
    "totalRouteTime": "0",
    "xForwardedPort": "443",
    "xForwardedProto": "https"
    }
    },
    "buildTrigger": "1822"
    }