### Install FIT-Connect SDK via NPM Source: https://docs.fitko.de/fit-connect/docs/sdks/javascript-sdk/overview Instructions for installing the FIT-Connect JavaScript SDK using NPM. This includes standard installation, installing a specific version, and installing as a development dependency. Ensure Node.js and a package manager are installed. ```bash npm install @fitko/fit-connect npm install @fitko/fit-connect@1.0.0 npm install --save-dev @fitko/fit-connect ``` -------------------------------- ### .NET SDK Example for Routing Client Source: https://docs.fitko.de/fit-connect/docs/sending/get-destination Example demonstrating how to use the .NET SDK to create a routing client and find destinations. ```APIDOC ## .NET SDK Usage ### Description This example shows how to initialize the .NET SDK's routing client and use it to find destinations for a given administrative service and region. ### Code ```csharp // Initialize the routing client var routingClient = ClientFactory.GetRouterClient(FitConnectEnvironment.Testing, logger); // Find destinations asynchronously var routes = await routingClient.FindDestinationsAsync(leikaKey, ars); ``` ### Parameters - **leikaKey** (string) - Required - The key for the administrative service. - **ars** (string) - Required - The Official Regional Key (Amtlicher Regionalschlüssel), Official Municipal Key (Amtlicher Gemeindeschlüssel), or AreaId. - **FitConnectEnvironment** (enum) - Specifies the Fit-Connect environment (e.g., `FitConnectEnvironment.Testing`). - **logger** (optional) - An optional logger instance. ``` -------------------------------- ### Example: Selecting 'fitConnect' Reply Channel Source: https://docs.fitko.de/fit-connect/docs/reply-channels/einstellungen-sender This example demonstrates how to configure the metadata for a submission to select 'fitConnect' as the reply channel. It includes the necessary schema version and details for encryption. ```APIDOC ## POST /submit ### Description Submits data using the Fit-Connect reply channel. ### Method POST ### Endpoint /submit ### Parameters #### Request Body - **$schema** (string) - Required - The version of the metadata schema. - **replyChannel** (object) - Required - Configuration for the reply channel. - **fitConnect** (object) - Required - Configuration specific to the fitConnect reply channel. - **processStandards** (array of strings) - Required - List of process standards. - **encryptionPublicKey** (object) - Required - Public key for encryption. - **kty** (string) - Required - Key type (e.g., "RSA"). - **key_ops** (array of strings) - Required - Key operations (e.g., ["wrapKey"]). - **alg** (string) - Required - Encryption algorithm (e.g., "RSA-OAEP-256"). - **kid** (string) - Required - Key ID. - **n** (string) - Required - Modulus parameter. - **e** (string) - Required - Exponent parameter (e.g., "AQAB"). ### Request Example ```json { "$schema": "https://schema.fitko.de/fit-connect/metadata//metadata.schema.json", "replyChannel": { "fitConnect": { "processStandards": [ "urn:xoev-de:bmk:standard:xbau_2.4" ], "encryptionPublicKey": { "kty": "RSA", "key_ops": [ "wrapKey" ], "alg": "RSA-OAEP-256", "kid": "……(Key ID)……", "n": "……(Modulus Parameter)……", "e": "AQAB" } } } } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the submission status. - **message** (string) - A confirmation message. #### Response Example ```json { "status": "success", "message": "Submission processed successfully." } ``` ``` -------------------------------- ### Send Submission (.NET SDK Example) Source: https://docs.fitko.de/fit-connect/docs/sending/submit Example demonstrating how to use the .NET SDK to send a submission. This involves creating a Sender client and calling the SendAsync method. ```APIDOC ## .NET SDK Example for Sending Submission ### Description This example shows how to use the .NET SDK to send a submission. It requires prior creation of a submission and configuration of the `Sender` client with environment details, client ID, and client secret. ### Code Snippet ```csharp var clientId = "YOUR CLIENT ID"; var clientSecret = "YOUR CLIENT SECRET"; // Create Sender var sender = ClientFactory.GetSenderClient(FitConnectEnvironment.Testing, clientId, clientSecret, logger); // logger is optional // Send the submission await sender.SendAsync(sendableSubmission); ``` ### Notes - Ensure you have first created a submission. Refer to the 'Einreichung anlegen' article for an example. - Obtain `clientId` and `clientSecret` from the 'Accountregistrierung und Client-Verwaltung' page. - `FitConnectEnvironment.Testing` is used here; adjust as needed for other environments. - The `logger` parameter is optional. ``` -------------------------------- ### FIT-Connect Callback Example Request Source: https://docs.fitko.de/fit-connect/docs/details/callbacks An example of a POST request to the FIT-Connect callback endpoint, including the necessary HTTP headers for authentication and timestamp, along with the JSON payload. ```http POST /callbacks/fit-connect callback-authentication: 2056b372b5bcec06d8f11ab79b84b42d6cbe1c8e1178cdfa36e4385dcf717758aaa7599f417d9ec3e079087884f4fd59680bf713621383e2d4414ef74fb10df3 callback-timestamp: 1672527599 { "type":"https://schema.fitko.de/fit-connect/submission-api/callbacks/new-submissions", "submissions":[ { "destinationId":"d12caea8-f372-4eb1-b102-b0a228253a11", "submissionId":"f39ab143-d91a-474a-b69f-b00f1a1873c2", "caseId":"9eec7d3e-dc66-4f82-9f52-1520bf96a32e" } ] } ``` -------------------------------- ### GET /submission-api/v2/submissions/{submissionId} Source: https://docs.fitko.de/fit-connect/docs/getting-started/user-journey Retrieves a specific submission using its `submissionId`. Authentication is required. ```APIDOC ## Retrieve Submission ### Description This endpoint allows you to retrieve the details of a specific submission using its unique `submissionId`. The `Authorization` header must contain a valid Bearer token. ### Method GET ### Endpoint /submission-api/v2/submissions/{submissionId} ### Parameters #### Path Parameters - **submissionId** (string) - Required - The unique identifier of the submission to retrieve. #### Request Body None ### Request Example ```http GET /submission-api/v2/submissions/3aabd166-1b69-4eb9-9df6-5efbc5e5154a HTTP/1.1 Accept: */* Accept-Encoding: gzip, deflate Authorization: Bearer YOUR_ACCESS_TOKEN Connection: keep-alive Host: test.fit-connect.fitko.dev User-Agent: HTTPie/3.2.2 ``` ### Response #### Success Response (200) - **caseId** (string) - The unique identifier for the case. - **destinationId** (string) - The identifier for the destination. - **submissionId** (string) - The unique identifier for the submission. #### Response Example ```json { "caseId": "32e2a50f-a5c5-4720-8c66-453436931ffc", "destinationId": "736c4581-da80-4710-9384-d19ebe1ff2bc", "submissionId": "3aabd166-1b69-4eb9-9df6-5efbc5e5154a" } ``` ``` -------------------------------- ### Example: Complete SubmissionSender Configuration (JavaScript) Source: https://docs.fitko.de/fit-connect/docs/sdks/javascript-sdk/overview Demonstrates how to instantiate the SubmissionSender with a full set of configuration options, including custom values for timeout, retry attempts, and retry delay. ```javascript const sender = new SubmissionSender({ publicKeyUrl: 'https://fit-connect-backend.net/api/keys/{destinationId}', submissionUrl: 'https://fit-connect-backend.net/api/submit', timeout: 60000, // 60 Sekunden Timeout retryAttempts: 5, // 5 Wiederholungsversuche retryDelay: 2000, // 2 Sekunden zwischen Wiederholungen }) ``` -------------------------------- ### GET /submission-api/v2/submissions Source: https://docs.fitko.de/fit-connect/docs/getting-started/user-journey Retrieves a list of all submissions. The `Authorization` header must contain a valid Bearer token. ```APIDOC ## List Submissions ### Description This endpoint retrieves a list of all submissions associated with the authenticated user or client. Each submission object in the response contains `caseId`, `destinationId`, and `submissionId`. ### Method GET ### Endpoint /submission-api/v2/submissions ### Parameters #### Query Parameters - **offset** (integer) - Optional - The number of submissions to skip. - **count** (integer) - Optional - The maximum number of submissions to return. #### Request Body None ### Request Example ```http GET /submission-api/v2/submissions HTTP/1.1 Accept: */* Accept-Encoding: gzip, deflate Authorization: Bearer YOUR_ACCESS_TOKEN Connection: keep-alive Host: test.fit-connect.fitko.dev User-Agent: HTTPie/3.2.2 ``` ### Response #### Success Response (200) - **count** (integer) - The number of submissions returned in this response. - **offset** (integer) - The offset used for pagination. - **submissions** (array) - A list of submission objects. - **caseId** (string) - The unique identifier for the case. - **destinationId** (string) - The identifier for the destination. - **submissionId** (string) - The unique identifier for the submission. - **totalCount** (integer) - The total number of submissions available. #### Response Example ```json { "count": 5, "offset": 0, "submissions": [ { "caseId": "32e2a50f-a5c5-4720-8c66-453436931ffc", "destinationId": "736c4581-da80-4710-9384-d19ebe1ff2bc", "submissionId": "3aabd166-1b69-4eb9-9df6-5efbc5e5154a" }, { "caseId": "d24bd2bc-633e-4cf7-85ca-d43f88ac43d8", "destinationId": "736c4581-da80-4710-9384-d19ebe1ff2bc", "submissionId": "43b3112e-968e-47de-bdb8-c1b7e76d3b58" }, { "caseId": "1ab4d03c-67ba-4e21-b87c-58939569c40f", "destinationId": "736c4581-da80-4710-9384-d19ebe1ff2bc", "submissionId": "c82585d8-e49d-4e27-abd6-be3dbf61a76f" }, { "caseId": "8fd0b344-1f21-427c-859d-de52ab4416db", "destinationId": "736c4581-da80-4710-9384-d19ebe1ff2bc", "submissionId": "db09f29b-9850-47ba-82aa-a91eca45fe12" }, { "caseId": "df41ae1a-ba0d-45d4-8c86-1fda829371bc", "destinationId": "736c4581-da80-4710-9384-d19ebe1ff2bc", "submissionId": "e1a07d22-aa68-41e7-b3db-c0903ac8a634" } ], "totalCount": 5 } ``` ``` -------------------------------- ### Get Routing Information via HTTP Request Source: https://docs.fitko.de/fit-connect/docs/getting-started/user-journey This snippet shows an HTTP GET request to the FIT-Connect routing API to determine the correct route for a submission. It requires the 'ars' and 'leikaKey' as query parameters. The response will contain routing information necessary for subsequent steps. ```http GET /v1/routes?ars=064350014014&leikaKey=99123456760610 HTTP/1.1 Accept: */* Accept-Encoding: gzip, deflate Connection: keep-alive Host: routing-api-testing.fit-connect.fitko.dev User-Agent: HTTPie/3.2.2 ``` -------------------------------- ### Create Submission (.NET SDK) Source: https://docs.fitko.de/fit-connect/docs/sending/start-submission Example demonstrating how to use the .NET SDK to create a submission. The submission can then be sent using the 'Einreichung versenden' functionality. ```APIDOC ## Create Submission (.NET SDK) ### Description This example shows how to create a `SendableSubmission` object using the .NET SDK. The `SendableSubmission` class handles unencrypted data, which is then encrypted internally. For pre-encrypted data, use `SendableEncryptedSubmission`. ### Method N/A (SDK method) ### Endpoint N/A (SDK method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body N/A (SDK object construction) ### Request Example ```csharp // Define destination and service identifier var destinationId = "aa3704d6-8bd7-4d40-a8af-501851f93934"; var serviceIdentifier = "urn:de:fim:leika:leistung:99400048079000"; // Build the sendable submission object var sendableSubmission = SendableSubmission.Builder() .SetDestination(destinationId) .SetServiceType(serviceIdentifier, "FIT Connect Demo") .SetJsonData("{\"message\":\"Hello World\"}") .AddAttachments( new Attachment("./Attachments/Test.pdf", "Test Attachment"), new Attachment("./Attachments/Test.pdf", "Test Attachment #2"), new Attachment(null, "Json Text Attachment", MediaTypeNames.Application.Json, Encoding.UTF8.GetBytes("{\"message\":\"Hello World\"}")) ) .SetAuthenticationInformation(new AuthenticationInformation("12345", AuthenticationInformationType.IdentificationReport, "1.3.5")) .SetPaymentInformation(new PaymentInformation(PaymentMethod.Creditcard, PaymentStatus.Booked, "12345445", "2345566")) .SetReplyChannel( new ReplyChannel { DeMail = new DeMail(address: "klaus.fischer@trash.de-mail.de") }) .Build(); ``` ### Response #### Success Response (200) N/A (SDK method) #### Response Example N/A (SDK method) ``` -------------------------------- ### Create Application Configuration using YAML Source: https://docs.fitko.de/fit-connect/docs/sdks/java-sdk/receiver Shows how to define the application configuration for an administration system in a YAML file. This includes subscriber credentials and the active environment. The configuration can then be loaded programmatically. ```yaml subscriberConfig: clientId: "clientId" clientSecret: "clientSecret" privateDecryptionKeyPaths: ["/decryption_key.json"] privateSigningKeyPath: "/signing_key.json" activeEnvironment: TEST ``` -------------------------------- ### GET /submission-api/v2/cases/{caseId}/events Source: https://docs.fitko.de/fit-connect/docs/getting-started/user-journey Retrieves a list of events associated with a specific case. Requires appropriate authorization to access case data. ```APIDOC ## GET /submission-api/v2/cases/{caseId}/events ### Description Retrieves a list of events associated with a specific case. Requires appropriate authorization to access case data. ### Method GET ### Endpoint /submission-api/v2/cases/{caseId}/events ### Parameters #### Path Parameters - **caseId** (string) - Required - The unique identifier of the case. #### Query Parameters None #### Request Body None ### Request Example ``` GET /submission-api/v2/cases/1ab4d03c-67ba-4e21-b87c-58939569c40f/events HTTP/1.1 Host: test.fit-connect.fitko.dev Authorization: Bearer Accept: */* ``` ### Response #### Success Response (200 OK) Returns a JSON array of event objects associated with the case. - **event_id** (string) - The unique identifier for the event. - **timestamp** (string) - The date and time the event occurred. - **type** (string) - The type of the event. - **details** (object) - Additional details about the event. #### Response Example ```json [ { "event_id": "e1a2b3c4-d5e6-f7a8-b9c0-d1e2f3a4b5c6", "timestamp": "2024-04-12T16:00:00Z", "type": "case_created", "details": { "user_id": "user123" } } ] ``` ``` -------------------------------- ### Get Submission Status (Java) Source: https://docs.fitko.de/fit-connect/docs/sdks/java-sdk/sender Illustrates how to send a submission and then retrieve its current status using the `getSubmissionStatus` method from the sender client. It also shows an example of the expected output. ```java SenderClient senderClient = ClientFactory.createSenderClient(config); SentSubmission sentSubmission = senderClient.send(submission); Status submissionStatus = senderClient.getSubmissionStatus(sentSubmission); LOGGER.info("Current status for submission {} => {}", sentSubmission.getSubmissionId(), submissionStatus.getStatus()); ``` ```text Current status for submission 43cf7163-5163-4bc8-865e-be96e271ecc3 => submitted ``` -------------------------------- ### Create Application Configuration using Java SDK Source: https://docs.fitko.de/fit-connect/docs/sdks/java-sdk/receiver Demonstrates how to create an application configuration for an administration system using the FIT-Connect Java SDK. This involves loading signing and decryption keys and building a SubscriberConfig and ApplicationConfig object. Dependencies include JWK, SubscriberConfig, ApplicationConfig, and Environment. ```java JWK signingKey = loadKey("/signing_key.json"); JWK decryptionKey = loadKey("/decryption_key.json"); var subscriber = SubscriberConfig.builder() .clientId("clientId") .clientSecret("clientSecret") .privateDecryptionKeys(List.of(decryptionKey)) .privateSigningKey(signingKey) .build(); var config = ApplicationConfig.builder() .subscriberConfig(subscriber) .activeEnvironment(TEST.getEnvironmentName()) .build(); ``` -------------------------------- ### List Submissions via HTTP Request Source: https://docs.fitko.de/fit-connect/docs/getting-started/user-journey This snippet demonstrates an HTTP GET request to list submissions. The 'Authorization' header must include the 'access_token' obtained previously, prefixed with 'Bearer '. The endpoint is '/submission-api/v2/submissions'. ```http GET /submission-api/v2/submissions HTTP/1.1 Accept: */* Accept-Encoding: gzip, deflate Authorization: Bearer eyJraWQiOiJHb2JOIiwidHlwIjoiYXQrand0IiwiYWxnIjoiRWREU0EifQ.eyJzdWIiOiJiMzgwODM4YS05ZjI2LTQxOTEtODgwNi1jM2NhNDRlYWJkNWIiLCJhdWQiOiJodHRwczovL2ZpdC1jb25uZWN0LmZpdGtvLmRlLyIsInNjb3BlIjoibWFuYWdlOmRlc3RpbmF0aW9uOjczNmM0NTgxLWRhODAtNDcxMC05Mzg0LWQxOWViZTFmZjJiYyBzdWJzY3JpYmU6ZGVzdGluYXRpb246NzM2YzQ1ODEtZGE4MC00NzEwLTkzODQtZDE5ZWJlMWZmMmJjIGh0dHBzOi8vc2NoZW1hLmZpdGtvLmRlL2ZpdC1jb25uZWN0L29hdXRoL3Njb3Blcy9zZWxmLXNlcnZpY2UtcG9ydGFsLWFwaS9tYW5hZ2U6ZGVzdGluYXRpb246NzM2YzQ1ODEtZGE4MC00NzEwLTkzODQtZDE5ZWJlMWZmMmJjIiwiaXNzIjoiaHR0cHM6Ly9hdXRoLXRlc3RpbmcuZml0LWNvbm5lY3QuZml0a28uZGV2IiwiZXhwIjoxNzEyOTQxMDQwLCJpYXQiOjE3MTI5MzkyNDAsImp0aSI6IloyLWNyY3pvOFYwIiwiY2xpZW50X2lkIjoiYjM4MDgzOGEtOWYyNi00MTkxLTg4MDYtYzNjYTQ0ZWFiZDViIn0.mt0sIp0SIt7oyhKa_J3rrG3ynsF0FUZrkPR4bulaTrh7nA4BSFxx_MEXN5rufj89kyR7tVlU7e05E_hR5xx8Aw Connection: keep-alive Host: test.fit-connect.fitko.dev User-Agent: HTTPie/3.2.2 ``` -------------------------------- ### Retrieve Submission List using cURL Source: https://docs.fitko.de/fit-connect/docs/receiving/notification This example shows how to retrieve a list of submissions ready for pickup using cURL. It requires setting environment variables for the submission API endpoint and a JWT token for authorization. The request is a GET request to the `/v2/submissions` endpoint. ```bash $ export SUBMISSION_API=https://test.fit-connect.fitko.dev/submission-api $ export JWT_TOKEN=eyJhbGciOiJIUzI1NiJ9.eyJJc3N1Z...NL-MKFrDGvn9TvkA $ curl \ -H "Authorization: Bearer $JWT_TOKEN" \ -H "Content-Type: application/json" \ -X GET "$SUBMISSION_API/v2/submissions" ``` -------------------------------- ### Create SDK Clients in Java Source: https://docs.fitko.de/fit-connect/docs/sdks/java-sdk/overview Instantiate Sender, Subscriber, and Router clients using the `ClientFactory` in Java. This process requires a pre-loaded `ApplicationConfig` object, which contains all the necessary settings for client initialization. ```java final SenderClient senderClient = ClientFactory.createSenderClient(config); final SubscriberClient subscriberClient = ClientFactory.createSubscriberClient(config); final RouterClient routerClient = ClientFactory.createRouterClient(config); ``` -------------------------------- ### FIM Fachschemareferenz - XML Example Source: https://docs.fitko.de/fit-connect/docs/getting-started/submission/data Example of a FIM Fachschemareferenz for XML data. ```APIDOC ## FIM Fachschemareferenz - XML ### Description This section provides an example of how to structure a reference to a FIM Fachschema for XML data. ### Request Body Example ```json { "schemaUri": "https://schema.fim.fitko.net/immutable/schemas/S00000092V1.1_2024-03-27-1711553459282.xsd", "mimeType": "application/xml" } ``` ### Parameters - **schemaUri** (string) - Required - The URI referencing the FIM Fachschema for XML data. - **mimeType** (string) - Required - The MIME type, which should be "application/xml" for XML data. ``` -------------------------------- ### Configure FIT-Connect Java SDK using YAML or Builder Source: https://docs.fitko.de/fit-connect/docs/sdks/java-sdk/sender Demonstrates how to create an application configuration for the FIT-Connect Java SDK. Configuration can be done either programmatically using the `ApplicationConfig.builder()` or via a YAML file (`config.yml`). The `ApplicationConfigLoader` is used to load the configuration from a specified path. ```java var config = ApplicationConfig.builder() .senderConfig(new SenderConfig("clientId", "clientSecret")) .activeEnvironment(Environments.TEST.getEnvironmentName()) .build(); ApplicationConfigLoader.loadConfigFromPath(Path.of("/path/to/config")); ``` ```yaml senderConfig: clientId: "clientId" clientSecret: "clientSecret" activeEnvironment: TEST ``` -------------------------------- ### Fit-Connect Environment Details Source: https://docs.fitko.de/fit-connect/docs/sdks/java-sdk/overview This section details the available environments (PROD, STAGE, TEST) for the Fitko.de Fit-Connect SDK, including their respective base URLs and configuration parameters. ```APIDOC ## Fit-Connect Environment Details ### Description This section details the available environments (PROD, STAGE, TEST) for the Fitko.de Fit-Connect SDK, including their respective base URLs and configuration parameters. ### Environments | Feature | PROD | STAGE | TEST | |---|---|---|---| | AuthBaseURL | `https://auth-prod.fit-connect.fitko.net` | `https://auth-refz.fit-connect.fitko.net` | `https://auth-testing.fit-connect.fitko.dev` | | RoutingBaseURL | `https://routing-api-prod.fit-connect.fitko.net` | `https://routing-api-prod.fit-connect.fitko.net` | `https://routing-api-testing.fit-connect.fitko.dev` | | SubmissonBaseURLs | `https://prod.fit-connect.fitko.net/submission-api` | `https://stage.fit-connect.fitko.net/submission-api` | `https://test.fit-connect.fitko.dev/submission-api` | | SelfServicePortalBaseURL | `https://portal.auth-prod.fit-connect.fitko.net` | `https://portal.auth-refz.fit-connect.fitko.net` | `https://portal.auth-testing.fit-connect.fitko.dev` | | enableAutoReject | `true` | `true` | `true` | | allowInsecurePublicKey | `false` | `false` | `true` | | skipSubmissionDataValidation | `false` | `false` | `false` | ### Usage Developers can use these base URLs and configuration options when integrating with the Fitko.de Fit-Connect SDK to target specific deployment environments. ``` -------------------------------- ### FIM Fachschemareferenz - JSON Example Source: https://docs.fitko.de/fit-connect/docs/getting-started/submission/data Example of a FIM Fachschemareferenz for JSON data. ```APIDOC ## FIM Fachschemareferenz - JSON ### Description This section provides an example of how to structure a reference to a FIM Fachschema for JSON data. ### Request Body Example ```json { "schemaUri": "https://schema.fim.fitko.net/immutable/schemas/S00000092V1.1_2024-03-27-1711553458904.schema.json", "mimeType": "application/json" } ``` ### Parameters - **schemaUri** (string) - Required - The URI referencing the FIM Fachschema for JSON data. - **mimeType** (string) - Required - The MIME type, which should be "application/json" for JSON data. ``` -------------------------------- ### .NET SDK: Initialize Routing Client Source: https://docs.fitko.de/fit-connect/docs/sending/get-destination Initializes the routing client for the FIT-Connect SDK. Requires the environment (e.g., Testing) and optionally a logger. The client factory is used to obtain the router client instance. ```.NET var routingClient = ClientFactory.GetRouterClient(FitConnectEnvironment.Testing, logger); ``` -------------------------------- ### Direct URL Call Examples for Routing API V2 Source: https://docs.fitko.de/fit-connect/docs/sending/get-destination Examples of directly calling the Routing API V2 endpoints via URL. These examples demonstrate querying routes using ARS, AGS, or AreaId, along with the leikaKey. ```URL https://routing-api-testing.fit-connect.fitko.dev/v2/routes?ars=160510000000&leikaKey=99008001014002 ``` ```URL https://routing-api-testing.fit-connect.fitko.dev/v2/routes?ags=16051000&leikaKey=99008001014002 ``` ```URL https://routing-api-testing.fit-connect.fitko.dev/v2/routes?areaId=11684&leikaKey=99008001014002 ``` -------------------------------- ### Load Application Configuration from Path using Java SDK Source: https://docs.fitko.de/fit-connect/docs/sdks/java-sdk/receiver Illustrates how to load an application configuration from a specified path using the `ApplicationConfigLoader` in the FIT-Connect Java SDK. This requires the `Path` class and `ApplicationConfigLoader`. ```java var path = Path.of("/path/to/config"); ApplicationConfigLoader.loadConfigFromPath(path); ``` -------------------------------- ### Direct URL Call Examples for Routing API V1 Source: https://docs.fitko.de/fit-connect/docs/sending/get-destination Examples of directly calling the Routing API V1 endpoints via URL. These examples show how to query routes using ARS, AGS, or AreaId, along with the leikaKey. ```URL https://routing-api-testing.fit-connect.fitko.dev/v1/routes?ars=160510000000&leikaKey=99008001014002 ``` ```URL https://routing-api-testing.fit-connect.fitko.dev/v1/routes?ags=16051000&leikaKey=99008001014002 ``` ```URL https://routing-api-testing.fit-connect.fitko.dev/v1/routes?areaId=11684&leikaKey=99008001014002 ``` -------------------------------- ### Metadata Verification - .NET Example Source: https://docs.fitko.de/fit-connect/docs/receiving/verification Example code in .NET demonstrating SHA512 hash verification. ```APIDOC ## Metadata Verification - .NET Example ### Description This .NET code snippet demonstrates how to compute and verify a SHA512 hash. It reads an embedded resource file, computes its hash, and compares it against a provided hash string after converting it to bytes. ### Method N/A (Code Example) ### Endpoint N/A (Code Example) ### Parameters N/A (Code Example) ### Request Example ```csharp using System; using System.Security.Cryptography; using System.Reflection; string hashFromSender = "bf85bd96831e5df2200b76a8c7e3c74044e96bc30d1ffc3d1c4b05d4ee5b258714ab28a4ee12c9eb7f7cec1878d49036f4ccaf809a6c9545707fb1b91f2676ae"; using (Stream? inputData = Assembly.GetExecutingAssembly().GetManifestResourceStream("example.pdf")) { if (inputData == null) { Console.Error.WriteLine("Error reading file from assembly."); return; } using (var hashFunction = SHA512.Create()) { byte[] hash = hashFunction.ComputeHash(inputData); byte[] comparisonHash = Convert.FromHexString(hashFromSender); Console.Write("Subscriber: Verification "); if (hash.SequenceEqual(comparisonHash)) { Console.WriteLine("OK"); } else { Console.WriteLine("FAILED"); } } } ``` ### Response #### Success Response (200) N/A (Code Example) #### Response Example ``` Subscriber: Verification OK ``` ``` -------------------------------- ### Send Submission (JavaScript/axios Example) Source: https://docs.fitko.de/fit-connect/docs/sending/submit Example using JavaScript with the axios library to send a submission. ```APIDOC ## JavaScript (axios) Example for Sending Submission ### Description This example uses the `axios` library in JavaScript to send a submission. It configures the request with the necessary headers and data, including the encrypted metadata. ### Code Snippet ```javascript const axios = require('axios'); const data = JSON.stringify({ "encryptedMetadata": "eyJhbGciOi...H82t9kVSf3Q" }); const SUBMISSION_ID = "a562cf6a-3860-4a7e-96e3-1d01f8a5252d"; const TOKEN = "eyJraWQiOiJHb2JOIiwi...NtPaYZ8YWHXh1TWcb2uhLVVnDBQ"; const SUBMISSION_API = "https://test.fit-connect.fitko.dev/submission-api"; const config = { method: 'put', url: SUBMISSION_API + '/v2/submissions/' + SUBMISSION_ID, headers: { 'Authorization': 'Bearer ' + TOKEN, 'Content-Type': 'application/json' }, data : data }; axios(config) .then(response => console.log(JSON.stringify(response.data))) .catch(error => console.log(error)); ``` ### Notes - Replace placeholder values with your actual token and submission ID. - The `encryptedData` field is mandatory for API version 2.0.0 and above. For a complete request, include it in the `data` object. ``` -------------------------------- ### Example of Supported Metadata Versions Source: https://docs.fitko.de/fit-connect/docs/sending/accept-reject This JSON structure illustrates the configuration of a delivery point, including its identifier, status, public services, encryption key, and importantly, the list of supported metadata versions ('metadataVersions'). This information is crucial for clients to construct valid metadata schema URIs. ```json { "destinationId": "13ad2349-975c-4167-bcd8-da606b4e1d84", "status": "active", "publicServices": [ { "identifier": "urn:de:fim:leika:leistung:99107004018000", "submissionSchemas": [ { "schemaUri": "https://schema.fim.fitko.net/immutable/schemas/S00000121V1.0_2024-01-22-1705941957653.schema.json", "mimeType": "application/json" } ], "regions": [ "DE09" ] } ], "encryptionKid": "e4142167-7f03-4d4f-a8c9-c7ecc78f55f8", "metadataVersions": [ "1.0.0" ] } ``` -------------------------------- ### Send Submission (curl Example) Source: https://docs.fitko.de/fit-connect/docs/sending/submit Example using curl to send a submission to the Submission API. ```APIDOC ## curl Example for Sending Submission ### Description This example demonstrates how to send a submission using the `curl` command-line tool. It includes setting environment variables for the API endpoint, JWT token, submission ID, and encrypted metadata. ### Command ```bash export SUBMISSION_API=https://test.fit-connect.fitko.dev/submission-api export JWT_TOKEN=eyJhbGciOiJIUzI1NiJ9.eyJJc3N1Z...NL-MKFrDGvn9TvkA export SUBMISSION_ID=63f0c991-0635-4e18-8a4b-fb0c01de9f5c export ENC_META_DATA=6r4H2H_WIzCv8Pd-uetmcbK...iVBKF3ylHRUahmZ curl -L -X PUT "$SUBMISSION_API/v2/submissions/$SUBMISSION_ID" \ -H "Authorization: Bearer $JWT_TOKEN" \ -H "Content-Type: application/json" \ --data-raw "{ \"encryptedMetadata\": \"$ENC_META_DATA\" }" ``` ### Notes - Replace placeholder values with your actual credentials and IDs. - The `encryptedData` field is mandatory for API version 2.0.0 and above, but is omitted in this simplified `curl` example for brevity. For a complete request, include it as shown in the main endpoint documentation. ``` -------------------------------- ### Onlinedienst mit .NET-SDK entwickeln Source: https://docs.fitko.de/fit-connect/docs/sdks/net-sdk/sender Anleitung zur Entwicklung eines Onlinedienstes mit dem .NET SDK. Beinhaltet Schritte zur Erstellung, zum Senden und zur Überprüfung des Status von Submissions. Async-Aufrufe sollten vermieden werden. ```.NET using FitConnect.Sdk.Core.Client; using FitConnect.Sdk.Core.Model; using System; using System.Threading.Tasks; public class OnlineServiceDevelopment { public async Task DevelopOnlineService(string destinationId, string serviceIdentifier) { // 1. Schritt: Onlinedienst erstellen var clientFactory = new ClientFactory(); var senderClient = clientFactory.GetSenderClient(); // 2. Schritt: Submission erstellen var submission = new SendableSubmission.Builder() .SetDestination(destinationId) .SetServiceType(serviceIdentifier, "FIT Connect Demo") .SetJsonData("{\"message\":\"Hello World\"}", new Uri("https://schema.example.com")) // .AddAttachments(...) // .SetAuthenticationInformation(...) // .SetPaymentInformation(...) // .SetReplyChannel(...) .Build(); // 3. Schritt: Submission senden var sendResult = await senderClient.SendAsync(submission); // 4. Schritt: Status überprüfen var status = await senderClient.GetStatusForSubmissionAsync(sendResult.SubmissionId); Console.WriteLine($"Submission Status: {status.Status}"); } } ```