The callback view only processes the most recent recipient event in a callback payload. In the case of signing order, though, a signer marked as "Completed" is reported as a simultaneous event along with the next signer's "Sent" event in the ordering. This means the callback view misses the first signer's event.
<RecipientStatus>
<Type>Signer</Type>
<Email>[email protected]</Email>
<UserName>First Signer</UserName>
<RoutingOrder>1</RoutingOrder>
<Sent>2016-11-14T15:42:29.037</Sent>
<Delivered>2016-11-14T15:45:46.667</Delivered>
<DeclineReason xsi:nil="true"/>
<Status>Delivered</Status>
<RecipientIPAddress>1.1.1.1</RecipientIPAddress>
<ClientUserId>17</ClientUserId>
<CustomFields/>
<AccountStatus>Active</AccountStatus>
<RecipientId>1aa6002b-5d93-4549-a45f-7e5906327d9e</RecipientId>
</RecipientStatus>
<RecipientStatus>
<Type>Signer</Type>
<Email>[email protected]</Email>
<UserName>Second Signer</UserName>
<RoutingOrder>2</RoutingOrder>
<DeclineReason xsi:nil="true"/>
<Status>Created</Status>
<RecipientIPAddress/>
<ClientUserId>18</ClientUserId>
<CustomFields/>
<AccountStatus>Active</AccountStatus>
<RecipientId>f599463d-8172-40ae-9e38-c004bdfcd9a8</RecipientId>
</RecipientStatus>
<RecipientStatus>
<Type>Signer</Type>
<Email>[email protected]</Email>
<UserName>First Signer</UserName>
<RoutingOrder>1</RoutingOrder>
<Sent>2016-11-14T15:42:29.037</Sent>
<Delivered>2016-11-14T15:45:46.667</Delivered>
<Signed>2016-11-14T15:46:13.153</Signed>
<DeclineReason xsi:nil="true"/>
<Status>Completed</Status>
<RecipientIPAddress>1.1.1.1</RecipientIPAddress>
<ClientUserId>17</ClientUserId>
<CustomFields/>
<TabStatuses>
<TabStatus>
<TabType>SignHere</TabType>
<Status>Signed</Status>
<XPosition>227</XPosition>
<YPosition>338</YPosition>
<DocumentID>1</DocumentID>
<PageNumber>1</PageNumber>
</TabStatus>
</TabStatuses>
<AccountStatus>Active</AccountStatus>
<RecipientId>1aa6002b-5d93-4549-a45f-7e5906327d9e</RecipientId>
</RecipientStatus>
<RecipientStatus>
<Type>Signer</Type>
<Email>[email protected]</Email>
<UserName>Second Signer</UserName>
<RoutingOrder>2</RoutingOrder>
<Sent>2016-11-14T15:46:13.653</Sent>
<DeclineReason xsi:nil="true"/>
<Status>Sent</Status>
<RecipientIPAddress/>
<ClientUserId>18</ClientUserId>
<CustomFields/>
<AccountStatus>Active</AccountStatus>
<RecipientId>f599463d-8172-40ae-9e38-c004bdfcd9a8</RecipientId>
</RecipientStatus>
Look what happens when pydocusign. parses the recipient events in the last request:
>>> from pydocusign.parser import DocuSignCallbackParser
>>> p = DocuSignCallbackParser(xml_payload)
>>> p.recipient_events
[{'clientUserId': u'17',
'datetime': datetime.datetime(2016, 11, 14, 15, 42, 29, 37000, tzinfo=tzoffset(None, -28800)),
'recipient': u'17',
'recipientId': u'1aa6002b-5d93-4549-a45f-7e5906327d9e',
'status': 'Sent'},
{'clientUserId': u'17',
'datetime': datetime.datetime(2016, 11, 14, 15, 45, 46, 667000, tzinfo=tzoffset(None, -28800)),
'recipient': u'17',
'recipientId': u'1aa6002b-5d93-4549-a45f-7e5906327d9e',
'status': 'Delivered'},
{'clientUserId': u'17',
'datetime': datetime.datetime(2016, 11, 14, 15, 46, 13, 153000, tzinfo=tzoffset(None, -28800)),
'recipient': u'17',
'recipientId': u'1aa6002b-5d93-4549-a45f-7e5906327d9e',
'status': 'Signed'},
{'clientUserId': u'18',
'datetime': datetime.datetime(2016, 11, 14, 15, 46, 13, 653000, tzinfo=tzoffset(None, -28800)),
'recipient': u'18',
'recipientId': u'f599463d-8172-40ae-9e38-c004bdfcd9a8',
'status': 'Sent'}]
The "Completed" event on the first signer is not the last event in the order, so it is not processed; only the "Sent" event for the second signer is processed.
Any ideas on a graceful way to handle this problem? i wonder if there'd be even more missing events if there were multiple recipients sharing the latter signing order, since they'd probably all be sent at once.