# FCA ECU Identity Registration

## API and SDK Documentation

Version: 2019-10-04

# Get an ECU Identity Certificate

# certificateEcusnGet

Request an issued certificate from the given `ecusn` (ECU Serial Number) value. An example of `ecusn` is `TF1161608J12340`

    /certificate/{ecusn}

### Usage and SDK Samples

    curl -X GET "https://kk7zceuzk3.execute-api.us-east-1.amazonaws.com/dev/certificate/{ecusn}?responseType="

    import io.swagger.client.*;
    import io.swagger.client.auth.*;
    import io.swagger.client.model.*;
    import io.swagger.client.api.DefaultApi;

    import java.io.File;
    import java.util.*;

    public class DefaultApiExample {

        public static void main(String[] args) {

            DefaultApi apiInstance = new DefaultApi();
            String ecusn = ecusn_example; // String | ECU Serial Number
            String responseType = responseType_example; // String | Requested Response Type
            try {
                certificate result = apiInstance.certificateEcusnGet(ecusn, responseType);
                System.out.println(result);
            } catch (ApiException e) {
                System.err.println("Exception when calling DefaultApi#certificateEcusnGet");
                e.printStackTrace();
            }
        }
    }

    import io.swagger.client.api.DefaultApi;

    public class DefaultApiExample {

        public static void main(String[] args) {
            DefaultApi apiInstance = new DefaultApi();
            String ecusn = ecusn_example; // String | ECU Serial Number
            String responseType = responseType_example; // String | Requested Response Type
            try {
                certificate result = apiInstance.certificateEcusnGet(ecusn, responseType);
                System.out.println(result);
            } catch (ApiException e) {
                System.err.println("Exception when calling DefaultApi#certificateEcusnGet");
                e.printStackTrace();
            }
        }
    }

    String *ecusn = ecusn_example; // ECU Serial Number
    String *responseType = responseType_example; // Requested Response Type

    DefaultApi *apiInstance = [[DefaultApi alloc] init];

    [apiInstance certificateEcusnGetWith:ecusn
        responseType:responseType
                  completionHandler: ^(certificate output, NSError* error) {
                                if (output) {
                                    NSLog(@"%@", output);
                                }
                                if (error) {
                                    NSLog(@"Error: %@", error);
                                }
                            }];

    var FcaEcuIdentityRegistration = require('fca_ecu_identity_registration');

    var api = new FcaEcuIdentityRegistration.DefaultApi()

    var ecusn = ecusn_example; // {String} ECU Serial Number

    var responseType = responseType_example; // {String} Requested Response Type

    var callback = function(error, data, response) {
      if (error) {
        console.error(error);
      } else {
        console.log('API called successfully. Returned data: ' + data);
      }
    };
    api.certificateEcusnGet(ecusn, responseType, callback);

    using System;
    using System.Diagnostics;
    using IO.Swagger.Api;
    using IO.Swagger.Client;
    using IO.Swagger.Model;

    namespace Example
    {
        public class certificateEcusnGetExample
        {
            public void main()
            {

                var apiInstance = new DefaultApi();
                var ecusn = ecusn_example;  // String | ECU Serial Number
                var responseType = responseType_example;  // String | Requested Response Type

                try
                {
                    certificate result = apiInstance.certificateEcusnGet(ecusn, responseType);
                    Debug.WriteLine(result);
                }
                catch (Exception e)
                {
                    Debug.Print("Exception when calling DefaultApi.certificateEcusnGet: " + e.Message );
                }
            }
        }
    }

    <?php
    require_once(__DIR__ . '/vendor/autoload.php');

    $api_instance = new Swagger\Client\Api\DefaultApi();
    $ecusn = ecusn_example; // String | ECU Serial Number
    $responseType = responseType_example; // String | Requested Response Type

    try {
        $result = $api_instance->certificateEcusnGet($ecusn, $responseType);
        print_r($result);
    } catch (Exception $e) {
        echo 'Exception when calling DefaultApi->certificateEcusnGet: ', $e->getMessage(), PHP_EOL;
    }
    ?>

    use Data::Dumper;
    use WWW::SwaggerClient::Configuration;
    use WWW::SwaggerClient::DefaultApi;

    my $api_instance = WWW::SwaggerClient::DefaultApi->new();
    my $ecusn = ecusn_example; # String | ECU Serial Number
    my $responseType = responseType_example; # String | Requested Response Type

    eval {
        my $result = $api_instance->certificateEcusnGet(ecusn => $ecusn, responseType => $responseType);
        print Dumper($result);
    };
    if ($@) {
        warn "Exception when calling DefaultApi->certificateEcusnGet: $@\n";
    }

    from __future__ import print_statement
    import time
    import swagger_client
    from swagger_client.rest import ApiException
    from pprint import pprint

    # create an instance of the API class
    api_instance = swagger_client.DefaultApi()
    ecusn = ecusn_example # String | ECU Serial Number
    responseType = responseType_example # String | Requested Response Type

    try:
        api_response = api_instance.certificate_ecusn_get(ecusn, responseType)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling DefaultApi->certificateEcusnGet: %s\n" % e)

## Parameters

Path parameters

Name | Description
--- | ---
ecusn* | String ECU Serial Number Required

Query parameters

Name | Description
--- | ---
responseType* | String Requested Response Type Required

## Responses

### Status: 200 - 200 response

### Status: 210 - 210 Octet response

### Status: 403 - 403 response

# certificateSerialnumberErrorErrorIDPost

Return Error Codes for failed certificate download and validation

    /certificate/{serialnumber}/error/{errorID}

### Usage and SDK Samples

    curl -X POST "https://kk7zceuzk3.execute-api.us-east-1.amazonaws.com/dev/certificate/{serialnumber}/error/{errorID}"

    import io.swagger.client.*;
    import io.swagger.client.auth.*;
    import io.swagger.client.model.*;
    import io.swagger.client.api.DefaultApi;

    import java.io.File;
    import java.util.*;

    public class DefaultApiExample {

        public static void main(String[] args) {

            DefaultApi apiInstance = new DefaultApi();
            Errorbody body = ; // Errorbody | Provides Error Responses
            String serialnumber = serialnumber_example; // String | Identifies the ECU
            String errorID = errorID_example; // String | Provides Error Message
            try {
                apiInstance.certificateSerialnumberErrorErrorIDPost(body, serialnumber, errorID);
            } catch (ApiException e) {
                System.err.println("Exception when calling DefaultApi#certificateSerialnumberErrorErrorIDPost");
                e.printStackTrace();
            }
        }
    }

    import io.swagger.client.api.DefaultApi;

    public class DefaultApiExample {

        public static void main(String[] args) {
            DefaultApi apiInstance = new DefaultApi();
            Errorbody body = ; // Errorbody | Provides Error Responses
            String serialnumber = serialnumber_example; // String | Identifies the ECU
            String errorID = errorID_example; // String | Provides Error Message
            try {
                apiInstance.certificateSerialnumberErrorErrorIDPost(body, serialnumber, errorID);
            } catch (ApiException e) {
                System.err.println("Exception when calling DefaultApi#certificateSerialnumberErrorErrorIDPost");
                e.printStackTrace();
            }
        }
    }

    Errorbody *body = ; // Provides Error Responses
    String *serialnumber = serialnumber_example; // Identifies the ECU
    String *errorID = errorID_example; // Provides Error Message

    DefaultApi *apiInstance = [[DefaultApi alloc] init];

    [apiInstance certificateSerialnumberErrorErrorIDPostWith:body
        serialnumber:serialnumber
        errorID:errorID
                  completionHandler: ^(NSError* error) {
                                if (error) {
                                    NSLog(@"Error: %@", error);
                                }
                            }];

    var FcaEcuIdentityRegistration = require('fca_ecu_identity_registration');

    var api = new FcaEcuIdentityRegistration.DefaultApi()

    var body = ; // {Errorbody} Provides Error Responses

    var serialnumber = serialnumber_example; // {String} Identifies the ECU

    var errorID = errorID_example; // {String} Provides Error Message

    var callback = function(error, data, response) {
      if (error) {
        console.error(error);
      } else {
        console.log('API called successfully.');
      }
    };
    api.certificateSerialnumberErrorErrorIDPost(body, serialnumber, errorID, callback);

    using System;
    using System.Diagnostics;
    using IO.Swagger.Api;
    using IO.Swagger.Client;
    using IO.Swagger.Model;

    namespace Example
    {
        public class certificateSerialnumberErrorErrorIDPostExample
        {
            public void main()
            {

                var apiInstance = new DefaultApi();
                var body = new Errorbody(); // Errorbody | Provides Error Responses
                var serialnumber = serialnumber_example;  // String | Identifies the ECU
                var errorID = errorID_example;  // String | Provides Error Message

                try
                {
                    apiInstance.certificateSerialnumberErrorErrorIDPost(body, serialnumber, errorID);
                }
                catch (Exception e)
                {
                    Debug.Print("Exception when calling DefaultApi.certificateSerialnumberErrorErrorIDPost: " + e.Message );
                }
            }
        }
    }

    <?php
    require_once(__DIR__ . '/vendor/autoload.php');

    $api_instance = new Swagger\Client\Api\DefaultApi();
    $body = ; // Errorbody | Provides Error Responses
    $serialnumber = serialnumber_example; // String | Identifies the ECU
    $errorID = errorID_example; // String | Provides Error Message

    try {
        $api_instance->certificateSerialnumberErrorErrorIDPost($body, $serialnumber, $errorID);
    } catch (Exception $e) {
        echo 'Exception when calling DefaultApi->certificateSerialnumberErrorErrorIDPost: ', $e->getMessage(), PHP_EOL;
    }
    ?>

    use Data::Dumper;
    use WWW::SwaggerClient::Configuration;
    use WWW::SwaggerClient::DefaultApi;

    my $api_instance = WWW::SwaggerClient::DefaultApi->new();
    my $body = WWW::SwaggerClient::Object::Errorbody->new(); # Errorbody | Provides Error Responses
    my $serialnumber = serialnumber_example; # String | Identifies the ECU
    my $errorID = errorID_example; # String | Provides Error Message

    eval {
        $api_instance->certificateSerialnumberErrorErrorIDPost(body => $body, serialnumber => $serialnumber, errorID => $errorID);
    };
    if ($@) {
        warn "Exception when calling DefaultApi->certificateSerialnumberErrorErrorIDPost: $@\n";
    }

    from __future__ import print_statement
    import time
    import swagger_client
    from swagger_client.rest import ApiException
    from pprint import pprint

    # create an instance of the API class
    api_instance = swagger_client.DefaultApi()
    body =  # Errorbody | Provides Error Responses
    serialnumber = serialnumber_example # String | Identifies the ECU
    errorID = errorID_example # String | Provides Error Message

    try:
        api_instance.certificate_serialnumber_error_error_id_post(body, serialnumber, errorID)
    except ApiException as e:
        print("Exception when calling DefaultApi->certificateSerialnumberErrorErrorIDPost: %s\n" % e)

## Parameters

Path parameters

Name | Description
--- | ---
serialnumber* | String Identifies the ECU Required
errorID* | String Provides Error Message Required

Body parameters

Name | Description
--- | ---
body * |

## Responses

### Status: 200 - 200 response

### Status: 403 - 403 response

# issuePost

Issue a certificate from a given CSR (Certificate Signing Requesti) value.

    /issue

### Usage and SDK Samples

    curl -X POST -H "Authorization: [[apiKey]]" "https://kk7zceuzk3.execute-api.us-east-1.amazonaws.com/dev/issue"

    import io.swagger.client.*;
    import io.swagger.client.auth.*;
    import io.swagger.client.model.*;
    import io.swagger.client.api.DefaultApi;

    import java.io.File;
    import java.util.*;

    public class DefaultApiExample {

        public static void main(String[] args) {
            ApiClient defaultClient = Configuration.getDefaultApiClient();

            // Configure API key authorization: bearerToken
            ApiKeyAuth bearerToken = (ApiKeyAuth) defaultClient.getAuthentication("bearerToken");
            bearerToken.setApiKey("YOUR API KEY");
            // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
            //bearerToken.setApiKeyPrefix("Token");

            DefaultApi apiInstance = new DefaultApi();
            Csrbody body = ; // Csrbody | Requires a PEM encoded CSR in body
            try {
                csr result = apiInstance.issuePost(body);
                System.out.println(result);
            } catch (ApiException e) {
                System.err.println("Exception when calling DefaultApi#issuePost");
                e.printStackTrace();
            }
        }
    }

    import io.swagger.client.api.DefaultApi;

    public class DefaultApiExample {

        public static void main(String[] args) {
            DefaultApi apiInstance = new DefaultApi();
            Csrbody body = ; // Csrbody | Requires a PEM encoded CSR in body
            try {
                csr result = apiInstance.issuePost(body);
                System.out.println(result);
            } catch (ApiException e) {
                System.err.println("Exception when calling DefaultApi#issuePost");
                e.printStackTrace();
            }
        }
    }

    Configuration *apiConfig = [Configuration sharedConfig];

    // Configure API key authorization: (authentication scheme: bearerToken)
    [apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"Authorization"];
    // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    //[apiConfig setApiKeyPrefix:@"Bearer" forApiKeyIdentifier:@"Authorization"];

    Csrbody *body = ; // Requires a PEM encoded CSR in body

    DefaultApi *apiInstance = [[DefaultApi alloc] init];

    [apiInstance issuePostWith:body
                  completionHandler: ^(csr output, NSError* error) {
                                if (output) {
                                    NSLog(@"%@", output);
                                }
                                if (error) {
                                    NSLog(@"Error: %@", error);
                                }
                            }];

    var FcaEcuIdentityRegistration = require('fca_ecu_identity_registration');
    var defaultClient = FcaEcuIdentityRegistration.ApiClient.instance;

    // Configure API key authorization: bearerToken
    var bearerToken = defaultClient.authentications['bearerToken'];
    bearerToken.apiKey = "YOUR API KEY"
    // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
    //bearerToken.apiKeyPrefix['Authorization'] = "Token"

    var api = new FcaEcuIdentityRegistration.DefaultApi()

    var body = ; // {Csrbody} Requires a PEM encoded CSR in body

    var callback = function(error, data, response) {
      if (error) {
        console.error(error);
      } else {
        console.log('API called successfully. Returned data: ' + data);
      }
    };
    api.issuePost(body, callback);

    using System;
    using System.Diagnostics;
    using IO.Swagger.Api;
    using IO.Swagger.Client;
    using IO.Swagger.Model;

    namespace Example
    {
        public class issuePostExample
        {
            public void main()
            {

                // Configure API key authorization: bearerToken
                Configuration.Default.ApiKey.Add("Authorization", "YOUR_API_KEY");
                // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
                // Configuration.Default.ApiKeyPrefix.Add("Authorization", "Bearer");

                var apiInstance = new DefaultApi();
                var body = new Csrbody(); // Csrbody | Requires a PEM encoded CSR in body

                try
                {
                    csr result = apiInstance.issuePost(body);
                    Debug.WriteLine(result);
                }
                catch (Exception e)
                {
                    Debug.Print("Exception when calling DefaultApi.issuePost: " + e.Message );
                }
            }
        }
    }

    <?php
    require_once(__DIR__ . '/vendor/autoload.php');

    // Configure API key authorization: bearerToken
    Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('Authorization', 'YOUR_API_KEY');
    // Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    // Swagger\Client\Configuration::getDefaultConfiguration()->setApiKeyPrefix('Authorization', 'Bearer');

    $api_instance = new Swagger\Client\Api\DefaultApi();
    $body = ; // Csrbody | Requires a PEM encoded CSR in body

    try {
        $result = $api_instance->issuePost($body);
        print_r($result);
    } catch (Exception $e) {
        echo 'Exception when calling DefaultApi->issuePost: ', $e->getMessage(), PHP_EOL;
    }
    ?>

    use Data::Dumper;
    use WWW::SwaggerClient::Configuration;
    use WWW::SwaggerClient::DefaultApi;

    # Configure API key authorization: bearerToken
    $WWW::SwaggerClient::Configuration::api_key->{'Authorization'} = 'YOUR_API_KEY';
    # uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    #$WWW::SwaggerClient::Configuration::api_key_prefix->{'Authorization'} = "Bearer";

    my $api_instance = WWW::SwaggerClient::DefaultApi->new();
    my $body = WWW::SwaggerClient::Object::Csrbody->new(); # Csrbody | Requires a PEM encoded CSR in body

    eval {
        my $result = $api_instance->issuePost(body => $body);
        print Dumper($result);
    };
    if ($@) {
        warn "Exception when calling DefaultApi->issuePost: $@\n";
    }

    from __future__ import print_statement
    import time
    import swagger_client
    from swagger_client.rest import ApiException
    from pprint import pprint

    # Configure API key authorization: bearerToken
    swagger_client.configuration.api_key['Authorization'] = 'YOUR_API_KEY'
    # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
    # swagger_client.configuration.api_key_prefix['Authorization'] = 'Bearer'

    # create an instance of the API class
    api_instance = swagger_client.DefaultApi()
    body =  # Csrbody | Requires a PEM encoded CSR in body

    try:
        api_response = api_instance.issue_post(body)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling DefaultApi->issuePost: %s\n" % e)

## Parameters

Body parameters

Name | Description
--- | ---
body * |

## Responses

### Status: 200 - 200 response

### Status: 403 - 403 response