Create Handshake API

AI Tools

Use this endpoint to register a handshake (also known as device session, flow session) with Attestr before launching the flow on user's device.


Request

Type

URL

POST

https://api.attestr.com/api/{version}/public/flowx/handshake

Request Body Parameters

Type

Name

Description

Optional (Default)

Min Version

Max Version

String

flow

Id of the flow for which handshake is being registered

Required

v1


String

snapshot

Snapshot version for the flow. Provide null if draft version of flow is being run.

Required

v1


String

tag

An identifier to uniquely identify the user / device eg. REF-1234

Required

v1


Boolean

webhook

Use this flag to enable webhook events

Optional

v1


Number

expiry

Unix timestamp in milliseconds for setting the expiry for the handshake. Default is 24 hours from the time handshake is created. Max. allowed value is 1 year. For more details on unix timestamp, read EpochConverter

Optional

v1


Request Header Parameters

Type

Name

Value / Description

Optional

Min Version

Max Version

String

Content-Type

application/json

Required

v1


String

Authorization

Basic {authToken}

Required

v1


Sample Request

{ "flow": "FX02zfeuvcj36knhn06us", "tag": "TAG567822", "snapshot": "d79c9c09-9367-4929-b0e3-b4eb38d0e4b8" }
{ "flow": "FX02zfeuvcj36knhn06us", "tag": "TAG567822", "snapshot": "d79c9c09-9367-4929-b0e3-b4eb38d0e4b8", "webhook": true, "expiry": 1675397411000 }

Response

HTTP status code 200

Key

Description

Type

Min Version

Max Version

_id

Id of the handshake

String

v1


number

Unique human readable number for this handshake

String

v1


digest

For future use

String

v1


Sample Response

{ "_id": "DS0ygRqYBPQ0ahzcw_", "number": "3897-518104-8640", "digest": "6411759d85aa50868e571c8e3d305f310e277dd29ec88d3726950f2c86bcd317" }

Error Response

Parameter

Type

Description

code

Number

Unique error codes for different errors. Always available.

message

String

Error message describing the error. Always Available.

details

String

Detail error message. Available only for certain types of errors.

Sample Error Response

{ "code": 4001, "message": "Malformed data or missing required parameter values" }

Error Codes

HTTP Status

Error Code

Error Message

Detail

400

4001

Malformed data or missing required parameter values


400

4005

Operation could not be performed due to low credits balance


400

4002

Flow ID does not exist


400

40034

Requested flow is inactive


401

4016

Invalid client authorization


403

4031

Unauthorized access


403

4035

Requested service is not provisioned for your account

Service name

403

4039

Client's IP address is not whitelisted


429

4291

Maximum account rate limit exceeded


429

4292

Maximum API rate limit exceeded


429

4293

Maximum account daily limit exceeded


429

4294

Maximum API daily limit exceeded


500

5001

Request could not be processed




  Last updated