Encode List - fennelLabs/fennel-service-api GitHub Wiki
POST /v1/whiteflag/encode_list/Encodes multiple WhiteFlag protocol messages in a batch operation. This endpoint takes an array of WhiteFlag message structures and encodes each one, with optional encryption for private communications between API groups.
This endpoint requires authentication. Include your token in the Authorization header:
Authorization: Token your_auth_token_here
{
"signals": [
{
"prefix": "WF",
"version": "1",
"encryptionIndicator": "0",
"duressIndicator": "0",
"messageCode": "T",
"referenceIndicator": "0",
"referencedMessage": "0000000000000000000000000000000000000000000000000000000000000000"
},
{
"prefix": "WF",
"version": "1",
"encryptionIndicator": "0",
"duressIndicator": "0",
"messageCode": "A",
"referenceIndicator": "0",
"referencedMessage": "0000000000000000000000000000000000000000000000000000000000000000",
"verificationMethod": "1",
"verificationData": "https://example.org/auth"
}
],
"recipient_group": "string"
}- signals (array, required): Array of WhiteFlag message objects to encode
- recipient_group (string, optional): API group name for encrypted private messaging
[
{
"signal": "574631000000000000000000000000000000000000000000000000000000000000000000",
"success": true,
"message": "signal encoded"
},
{
"signal": "574631000041000000000000000000000000000000000000000000000000000000000000",
"success": true,
"message": "signal encoded"
}
]{
"signals": ["This field is required."]
}# Encode multiple WhiteFlag messages
curl -X POST https://fennel.network/api/v1/whiteflag/encode_list/ \
-H "Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b" \
-H "Content-Type: application/json" \
-d '{
"signals": [
{
"prefix": "WF",
"version": "1",
"encryptionIndicator": "0",
"duressIndicator": "0",
"messageCode": "T",
"referenceIndicator": "0",
"referencedMessage": "0000000000000000000000000000000000000000000000000000000000000000"
},
{
"prefix": "WF",
"version": "1",
"encryptionIndicator": "0",
"duressIndicator": "0",
"messageCode": "E",
"referenceIndicator": "0",
"referencedMessage": "0000000000000000000000000000000000000000000000000000000000000000",
"subjectCode": "52",
"datetime": "2025-09-26T12:00:00Z",
"duration": "P1D",
"objectType": "01",
"objectLatitude": "+40.7128",
"objectLongitude": "-074.0060"
}
]
}'
# Encode with encryption for private group
curl -X POST https://fennel.network/api/v1/whiteflag/encode_list/ \
-H "Authorization: Token 9944b09199c62bcf9418ad846dd0e4bbdfc6ee4b" \
-H "Content-Type: application/json" \
-d '{
"signals": [
{
"prefix": "WF",
"version": "1",
"encryptionIndicator": "1",
"duressIndicator": "0",
"messageCode": "M",
"referenceIndicator": "0",
"referencedMessage": "0000000000000000000000000000000000000000000000000000000000000000",
"subjectCode": "10",
"datetime": "2025-09-26T12:00:00Z"
}
],
"recipient_group": "humanitarian_org"
}'Each encoded signal in the response contains:
- signal: Hexadecimal encoded WhiteFlag message
- success: Boolean indicating if encoding was successful
- message: Status message describing the result
The endpoint accepts signals in two formats:
{
"prefix": "WF",
"version": "1",
"messageCode": "T"
}"{'prefix': 'WF', 'version': '1', 'messageCode': 'T'}"When recipient_group is specified:
- Messages with
encryptionIndicator: "1"are encrypted for the recipient group - Sender must be a member of an API group for encryption to work
- Recipient group must exist in the system
- Encrypted messages can only be decoded by the recipient group
- Encode multiple messages for batch transmission
- Prepare message queues for blockchain sending
- Pre-process WhiteFlag communications
- Encode different message types in one request
- Handle authentication + operational messages together
- Process emergency and status updates simultaneously
- Encrypt sensitive humanitarian communications
- Secure operational coordination messages
- Protect confidential emergency response data
- All messages are processed independently - one failure doesn't stop others
- Requires authentication to access user's API group for encryption
- Mixed encrypted/unencrypted messages are supported in the same batch
- Invalid message structures return success: false with error details
- This endpoint requires the WhiteFlag CLI service to be operational
- Large batches may take longer to process due to individual encoding operations
- Encrypted messages require proper API group membership and permissions