Event Creation API Documentation

API Endpoint

  • URL: https://api.event-store.fr/create
  • Method: GET & POST

Domain Name

Environment Protocol Domain
PROD https https://api.event-store.fr/create

API Key Parameter

Parameter Description Example
x-api-key The API Key XXX1XX12XxxxXXxxXXx0xXxx

Query Parameters

Parameter Description Required Example
cl The name of the client True EDF
hs The name of the hyperscaler True AWS, GCP, AZU, CAV
ty The type of the event True START_EC2
ac The account number or name True 525060831330 or PRODUCTION
re The name of the region True eu-west-3
st The status True OK or KO
im The impact True MINOR or MODERATE or MAJOR or CRITICAL
me The informational message True Error step function
us_* Custom user fields False us_application=MyApp

Hyperscalers Shortcuts

  • AWS: Amazon Web Services
  • GCP: Google Cloud Platform
  • AZU: Microsoft Azure
  • CAV: Orange Cloud Avenue

Example Request

URL Format

https://api.event-store.fr/create?cl=EDF&hs=AWS&ty=START_EC2&ac=525060831330&re=eu-west-3&st=OK&me=Operation+successful

Integration Examples

Python


import requests
url = "https://api.event-store.fr/create"
params = {{
    "cl": "EDF",
    "hs": "AWS",
    "ty": "START_EC2",
    "ac": "525060831330",
    "re": "eu-west-3",
    "st": "OK",
    "im": "MINOR",
    "me": "Operation successful"
}}
headers = {{
    "x-api-key": "XXX1XX12XxxxXXxxXXx0xXxx"
}}
response = requests.get(url, params=params, headers=headers)
if response.status_code == 200:
    print("Event created successfully")
else:
    print(f"Error: {{response.status_code}}")
                                

Javascript


const fetch = require('node-fetch');
const url = "https://api.event-store.fr/create";
const params = {{
    cl: "EDF",
    hs: "AWS",
    ty: "START_EC2",
    ac: "525060831330",
    re: "eu-west-3",
    st: "OK",
    im: "MINOR",
    me: "Operation successful"
}};
const headers = {{
    "x-api-key": "XXX1XX12XxxxXXxxXXx0xXxx"
}};
const queryString = new URLSearchParams(params).toString();
const fullUrl = `${url}?${queryString}`;
fetch(fullUrl, {{ headers }})
    .then(response => {{
        if (response.ok) {{
            console.log("Event created successfully");
        }} else {{
            console.error(`Error: ${{response.status}}`);
        }}
    }})
    .catch(error => {{
        console.error(`Request failed: ${{error}}`);
    }});
                                

Powershell


$url = "https://api.event-store.fr/create"
$params = @{
    cl = "EDF"
    hs = "AWS"
    ty = "START_EC2"
    ac = "525060831330"
    re = "eu-west-3"
    st = "OK"
    im = "MINOR"
    me = "Operation successful"
}
$headers = @{
    "x-api-key" = "XXX1XX12XxxxXXxxXXx0xXxx"
}
$queryString = ($params.GetEnumerator() | ForEach-Object {{ "$($_.Key)=$($_.Value)" }}) -join "&"
$fullUrl = "$url?$queryString"
$response = Invoke-RestMethod -Uri $fullUrl -Method Get -Headers $headers
if ($response.StatusCode -eq 200) {{
    Write-Host "Event created successfully"
}} else {{
    Write-Host "Error: $($response.StatusCode)"
}}
                                

Shell GET


#!/bin/bash
url="https://api.event-store.fr/create"
params="cl=EDF&hs=AWS&ty=START_EC2&ac=525060831330&re=eu-west-3&st=OK&im=MINOR&me=Operation successful"
response=$(curl -s -H "x-api-key: XXX1XX12XxxxXXxxXXx0xXxx" -o /dev/null -w "%{{http_code}}" "$url?$params")
if [ "$response" -eq 200 ]; then
    echo "Event created successfully"
else
    echo "Error: $response"
fi
                                

Shell POST


#!/bin/bash
url="https://api.event-store.fr/create"
data='{
    "cl": "EDF",
    "hs": "AWS",
    "ty": "START_EC2",
    "ac": "525060831330",
    "re": "eu-west-3",
    "st": "OK",
    "im": "MINOR",
    "me": "Operation successful"
}'
response=$(curl -s -X POST -H "x-api-key: XXX1XX12XxxxXXxxXXx0xXxx" \
-H "Content-Type: application/json" \
-d "$data" \
-o /dev/null -w "%{http_code}" "$url")

if [ "$response" -eq 200 ]; then
    echo "Event created successfully"
else
    echo "Error: $response"
fi
                                

AWS Step Function Integration


# Fonction Lambda (Python)
import json
import requests
def lambda_handler(event, context):
    url = "https://api.event-store.fr/create"
    params = {{
        "cl": "EDF",
        "hs": "AWS",
        "ty": "START_EC2",
        "ac": "525060831330",
        "re": "eu-west-3",
        "st": "OK",
        "im": "MINOR",
        "me": "Operation successful"
    }}
    headers = {{
        "x-api-key": "XXX1XX12XxxxXXxxXXx0xXxx"
    }}
    response = requests.get(url, params=params, headers=headers)
    if response.status_code == 200:
        return {{
            'statusCode': 200,
            'body': json.dumps('Event created successfully')
        }}
    else:
        return {{
            'statusCode': response.status_code,
            'body': json.dumps(f"Error: {{response.status_code}}")
        }}
                                

Error Codes and Their Explanation

Here are the different error codes with their meaning:

Client name (cl) — C000
  • C001 is not a string
  • C002 is too short (less than 3 characters)
  • C003 is too long (more than 10 characters)
  • C004 contains illegal characters (only letters A-Z, a-z are allowed)
Event type (ty) — T000
  • T001 is not a string
  • T002 is too short (less than 3 characters)
  • T003 is too long (more than 20 characters)
  • T004 contains illegal characters (only A-Z, a-z, 0-9, -, and _ are allowed)
Hyperscaler (hs) — H000
  • H001 contains an illegal value (must be AWS, AZU, GCP, CAV, or OTH)
Account number or name (ac) — A000
  • A001 is not a string
  • A002 is too short (less than 3 characters)
  • A003 is too long (more than 20 characters)
  • A004 contains illegal characters (only A-Z, a-z, 0-9, - and _ are allowed)
Region name (re) — R000
  • R001 is not a string
  • R002 is too short (less than 3 characters)
  • R003 is too long (more than 20 characters)
  • R004 contains illegal characters (only A-Z, a-z, 0-9, - and _ are allowed)
Status (st) — S000
  • S001 contains an illegal value (must be OK, KO, or OO)
Message (me) — M000
  • M001 is not a string
  • M002 is too short (less than 3 characters)
  • M003 is too long (more than 255 characters)
  • M004 contains forbidden HTML characters (<, >)
Others
  • P001 Parameters not provided or invalid
  • 400 Bad Request
  • 500 Internal Server Error