Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 51 additions & 1 deletion markdownpages/profit/en/howto-remotecmd.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: AFAS Remote via the API
author: EZW
date: 2026-09-14
date: 2026-10-08
tags: API, Remote, Import
---

Expand Down Expand Up @@ -78,6 +78,56 @@ The response contains the `commandId` that you need to request the status of the
</soap:Envelope>
```

## Importing a GET connector

Besides data, you can also use the command connector to import the definition of a GET connector. This works the same way as an import, but with a different command line and a different file in the `<attachementArchive>` element.

### Command line

Use the `DEFINITIEIMPORT` action and provide the file name of the GET connector:

```
/O"O12345AA" DEFINITIEIMPORT /F"<GET connector name>.gcn"
```

### Definition file

Provide the definition as a base64-encoded ZIP in the `<attachementArchive>` element. The ZIP contains:

- the GET connector file (`<GET connector name>.gcn`);
- an `@#$MetaInfo.xml` file containing the file name of the GET connector.

The `@#$MetaInfo.xml` file has the following content:

```xml
<?xml version="1.0" encoding="utf-8" standalone="yes"?><InputFile_Name><GET connector name>.gcn</InputFile_Name>
Comment thread
Heimmot24 marked this conversation as resolved.
```

The file name in the command line must match the name of the `.gcn` file in the ZIP.

### Example

```bash
curl -X POST "https://12345.soap.afas.online/profitservices/cmdconnector.asmx" \
-H "Authorization: Bearer ..." \
-H "Content-Type: text/xml; charset=utf-8" \
-H "SOAPAction: urn:Afas.Profit.Services/Execute" \
-d '<?xml version="1.0" encoding="utf-8"?>
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body>
<Execute xmlns="urn:Afas.Profit.Services">
<token>nit</token>
<commandLine>/O"O12345AA" DEFINITIEIMPORT /F"SI_Verkooprelaties.gcn"</commandLine>
<attachementArchive>UEsDBBQACAAIAGJbSF0AAAAAAAAAAAAAAAAPACAAQCMkTWV0YUluZm8ueG1s...</attachementArchive>
</Execute>
</Body>
</Envelope>'
```

### Response

As with an import, the response contains the `commandId` that you can use to request the status of the command. See [Requesting the status](#requesting-the-status).

## Requesting the status

To request the status of a previously executed command, use the `GetState` command. Provide the `commandId` that you received in the response to the `Execute` command.
Expand Down
52 changes: 51 additions & 1 deletion markdownpages/profit/nl/howto-remotecmd.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: AFAS Remote via de API
author: EZW
date: 2026-09-14
date: 2026-10-08
tags: API, Remote, Import
---

Expand Down Expand Up @@ -78,6 +78,56 @@ In het response zie je de `commandId` terug die je nodig hebt om de status van d
</soap:Envelope>
```

## GET-connector importeren

Naast gegevens kun je via de cmdconnector ook de definitie van een GET-connector importeren. Dit werkt op dezelfde manier als een import, maar met een andere opdrachtregel en een ander bestand in het `<attachementArchive>`-element.

### Opdrachtregel

Gebruik de actie `DEFINITIEIMPORT` en geef de bestandsnaam van de GET-connector mee:

```
/O"O12345AA" DEFINITIEIMPORT /F"<GET connector naam>.gcn"
```

### Definitiebestand

De definitie lever je aan als een base64-gecodeerde ZIP in het `<attachementArchive>`-element. De ZIP bevat:

- het GET-connectorbestand (`<GET connector naam>.gcn`);
- een `@#$MetaInfo.xml`-bestand met daarin de bestandsnaam van de GET-connector.

Het `@#$MetaInfo.xml`-bestand heeft de volgende inhoud:

```xml
<?xml version="1.0" encoding="utf-8" standalone="yes"?><InputFile_Name><GET connector naam>.gcn</InputFile_Name>
Comment thread
Heimmot24 marked this conversation as resolved.
```

De bestandsnaam in de opdrachtregel moet overeenkomen met de naam van het `.gcn`-bestand in de ZIP.

### Voorbeeld

```bash
curl -X POST "https://12345.soap.afas.online/profitservices/cmdconnector.asmx" \
-H "Authorization: Bearer ..." \
-H "Content-Type: text/xml; charset=utf-8" \
-H "SOAPAction: urn:Afas.Profit.Services/Execute" \
-d '<?xml version="1.0" encoding="utf-8"?>
<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<Body>
<Execute xmlns="urn:Afas.Profit.Services">
<token>nit</token>
<commandLine>/O"O12345AA" DEFINITIEIMPORT /F"SI_Verkooprelaties.gcn"</commandLine>
<attachementArchive>UEsDBBQACAAIAGJbSF0AAAAAAAAAAAAAAAAPACAAQCMkTWV0YUluZm8ueG1s...</attachementArchive>
</Execute>
</Body>
</Envelope>'
```

### Response

Het response bevat, net als bij een import, de `commandId` waarmee je de status van de opdracht kunt opvragen. Zie [Status opvragen](#status-opvragen).

## Status opvragen

Om de status van een eerder uitgevoerde opdracht op te vragen, gebruik je het `GetState`-commando. Hierbij geef je het `commandId` mee dat je hebt ontvangen in het response van de `Execute`-opdracht.
Expand Down
Loading