diff --git a/markdownpages/profit/en/howto-remotecmd.md b/markdownpages/profit/en/howto-remotecmd.md index cc359a9..1204a32 100644 --- a/markdownpages/profit/en/howto-remotecmd.md +++ b/markdownpages/profit/en/howto-remotecmd.md @@ -1,7 +1,7 @@ --- title: AFAS Remote via the API author: EZW -date: 2026-09-14 +date: 2026-10-08 tags: API, Remote, Import --- @@ -78,6 +78,56 @@ The response contains the `commandId` that you need to request the status of the ``` +## 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 `` element. + +### Command line + +Use the `DEFINITIEIMPORT` action and provide the file name of the GET connector: + +``` +/O"O12345AA" DEFINITIEIMPORT /F".gcn" +``` + +### Definition file + +Provide the definition as a base64-encoded ZIP in the `` element. The ZIP contains: + +- the GET connector file (`.gcn`); +- an `@#$MetaInfo.xml` file containing the file name of the GET connector. + +The `@#$MetaInfo.xml` file has the following content: + +```xml +.gcn +``` + +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 ' + + + + nit + /O"O12345AA" DEFINITIEIMPORT /F"SI_Verkooprelaties.gcn" + UEsDBBQACAAIAGJbSF0AAAAAAAAAAAAAAAAPACAAQCMkTWV0YUluZm8ueG1s... + + + ' +``` + +### 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. diff --git a/markdownpages/profit/nl/howto-remotecmd.md b/markdownpages/profit/nl/howto-remotecmd.md index 76abf61..e304163 100644 --- a/markdownpages/profit/nl/howto-remotecmd.md +++ b/markdownpages/profit/nl/howto-remotecmd.md @@ -1,7 +1,7 @@ --- title: AFAS Remote via de API author: EZW -date: 2026-09-14 +date: 2026-10-08 tags: API, Remote, Import --- @@ -78,6 +78,56 @@ In het response zie je de `commandId` terug die je nodig hebt om de status van d ``` +## 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 ``-element. + +### Opdrachtregel + +Gebruik de actie `DEFINITIEIMPORT` en geef de bestandsnaam van de GET-connector mee: + +``` +/O"O12345AA" DEFINITIEIMPORT /F".gcn" +``` + +### Definitiebestand + +De definitie lever je aan als een base64-gecodeerde ZIP in het ``-element. De ZIP bevat: + +- het GET-connectorbestand (`.gcn`); +- een `@#$MetaInfo.xml`-bestand met daarin de bestandsnaam van de GET-connector. + +Het `@#$MetaInfo.xml`-bestand heeft de volgende inhoud: + +```xml +.gcn +``` + +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 ' + + + + nit + /O"O12345AA" DEFINITIEIMPORT /F"SI_Verkooprelaties.gcn" + UEsDBBQACAAIAGJbSF0AAAAAAAAAAAAAAAAPACAAQCMkTWV0YUluZm8ueG1s... + + + ' +``` + +### 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.