For a deeper look into our World Check One API, look into:

Overview |  Quickstart |  Documentation |  Downloads

question

Upvotes
Accepted
5 0 1 4

Please can you post a sample python file that can perform sync screening requests for the WC1 API?

pythonworld-checkworld-check-one
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Upvotes
Accepted
4.2k 8 5 6

@Yusuf.Jassat

Please find the python script to request the API call "SEQ-screen-sync-simple: Perform Synchronous Screening: Simple" in the attached.

Kindly note that this is just a sample python code designed to describe the users on how to write their own code. This should not be used in the client's production application.


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

hi im new to wc1 api, im trying to modify the python code you posted to get group info, very basic, however, the signature generated from the code is different from postman, why would that be the case? below is the code im using


api_token=api_secret.encode()

datatosign= "(request-target): get " + gatewayurl + "groups\n" + \

"host: " + gatewayhost + "\n" + \

"date: " + date + "\n"

#"date: " + date + "\n" +\

#"content-type: " + content_type +"\n" +\

#"content-length: " + str_length +"\n"+\

#content.decode()


print (datatosign)


byte_datatosign=datatosign.encode()

def hbase(byte_datatosign,api_token):

encrypt=hmac.new(api_token, byte_datatosign, digestmod= hashlib.sha256)

digest_maker=encrypt.digest()

base=base64.b64encode(digest_maker)

return base.decode()

found the issue, remove the extra "\n" in "date: " + date + "\n" worked for me