Endpoints

Endpoint Overview

One Ticket API provides four different endpoints as follows:

  1. Generate Ticket: Used to create a new ticket for a user.
  2. Get Ticket: Used to retrieve ticket information.
  3. Scan Ticket: Used to scan/validate a ticket.
  4. Transfer Ticket: Used to transfer a ticket to a new owner.

End point 1: Generate Ticket

  1. This endpoint strictly validates incoming data. Ensure your request matches the specified schema and does not include any additional fields.
  2. If the user does not exist, this endpoint will automatically create the user. No additional processing is required from your side.
  3. If the event does not exist, this endpoint will automatically create it. No additional processing is required from your side.
Request : POST | https://sandbox.one-ticket.fr/api/generate_ticket
{
    client_id: "user1",
    client_firstname: "test",
    client_lastname: "test",
    event_id: "event1",
    event_name: "test"
}

You should apply the Security Protocol to generate a valid signature using your signature key.

{
    client_id: "user1",
    client_firstname: "test",
    client_lastname: "test",
    event_id: "event1",
    event_name: "test",
    signature: "833f8783b3cc.........."
}

Request data should be encrypted using the crypt key before being sent to the endpoint. Refer to the Security Protocol for additional information.

{
    data: "encryptedData",
    token: "token"
}
Response

Our server always responds with encrypted data using the same Security Protocol.

{
    data: "U2FsdGVkX18Rip6kq9GtW74FbBGuXX8oeNz4MVxKlpY1qYe2qaqk/RyrKCzcYQVl1PORYHCuxyTGy0f4+n1WsANvCBDJwt+eDcaw8Ripl74n1z7hbGxUb8dT1hRX3twiiWCHqtPeTSvGEHSVvN9vgFVB3tm5ANU8VBWLu29ycuIPa1Yp+1sN7pWowUdBD9ZLPRWXm3+1NDWwXso7pbnKqmtM5gZvkYx2kv5I6dcpvgVTg3pSihbrHSCr+lj6dxmg5OcPZ0hwLlGg3TouNVT6A3XQGc02MmNBJu/Y/2v1+Hs2tte/pJg0cNV/YwsTeGW6jy2nOnGhLzpLIEOv6N0981HiFXz01jDXXWcHDq87TVmcQ7f9FA8Xs4edlh7T89mR6j5fFwWKKIcw9R8nsenCe+MNV99hgdBH5lne62RaaZgVSELK+lDes9kIGdAFCOyhOCbZr0Wm2V76mwRlEmxfLE8YSHi1T3KXyVf3KuycuzZWTUejWYDsp8giXGQN5CMo32+B2F32zXwZWDvix8gYXA==",
}
  1. Decrypt the response using your crypt key.
  2. The user's private key and recovery details are only communicated once when a new user is created. Store them securely. If the user already exists, only the wallet information will be included in the response.
  3. The ticket object always includes the contract address. The ticket_id represents the NFT ID on the contract, while the one_ticket_id represents the ticket ID in our system. Keep it safe for future requests (get, scan, transfer).
  4. For maximum security, we strongly recommend verifying the signature using the same Security Protocol to ensure the response is from our servers.
{
    user: {
        wallet: '0x77F971D3DB26........',
        private_key: '0x9c94d03a86f8fa613e2e4b9df5b8...........',
        recovery: 'reunion promote almost derive .........'
    },
    ticket: {
        contrat_address: '0xa32AB63b41723E6.......',
        ticket_id: '1',
        one_ticket_id: '678d34fecd......'
    },
    signature: "833f83b783cc.........."
}

In order to verify the signature for this scenario, your ordered base string must look like this:

tiketcontrat_address0xa32AB63b41723E6.......one_ticket_id678d34fecd......ticket_id1userprivate_key0x9c94d03a86f8fa613e2e4b9df5b8...........recoveryreunionpromotealmostderive.........wallet0x77F971D3DB26........keysignature_key

End point 2: Get Ticket

  1. This endpoint strictly validates incoming data. Ensure your request matches the specified schema and does not include any additional fields.
  2. Use the one_ticket_id field provided during the generation process as the ticket_id.
Request : POST | https://sandbox.one-ticket.fr/api/get_ticket
{
    ticket_id: "678d34fecd......",
}

You should apply the Security Protocol to generate a valid signature using your signature key.

{
    ticket_id: "678d34fecd......",
    signature: "8a061333cb92.........."
}

Request data should be encrypted using the crypt key before being sent to the endpoint. Refer to the Security Protocol for additional information.

{
    data: "encryptedData",
    token: "token"
}
Response

Our server always responds with encrypted data using the same Security Protocol.

{
    data: "U2FsdGVkX1+8YktteAcjyGNljrdFmwR+raGDWu6Mzlk91v60kM3uFIrxPr4nKK2pdKdnco+fhLGJYOWTU+57/w7G/UwDl/WAbyy7ulExkG+tSJ077HswPU83/oDQZMQItrRrG44V4okxPwbyX4uxeLwslV6dsGYj9rKCN83/AsLxChgUHP3aN2GPdiuozxWrL0Ji/APHumXmSVGWaEhU7E0v4SWIbqv5wqCRqSbmMl/NX0X6CSKDbdd0Jm5n/L/NGmcjX7uqO6Nh47ibYqXz1ii2e+Y7sQREvFLO3g4i+4p2IugeWyPT3x2sLXgjOpwrDdzGjf9Cd7BTIn3foK5UAmz74AEAZ3UU3mWPZZgPeXyqO1SLg6kOdBZbt6+n7rjwKv9zaHTSBkyGLFra/mzSoPxH9kgBjkv9YB04Lri3gflERKLpdxMTaej3yB5a7DLmqgzkIPT6gWOfcPV6wg+R4w==",
}
  1. Decrypt the response using your crypt key.
  2. For maximum security, we strongly recommend verifying the signature using the same Security Protocol to ensure the response is from our servers.
{
    one_ticket_id: '678d34fecd......',
    eventID: '1',
    eventName: 'test',
    owner: '0x77F971D3DB2639a2......',
    nft_url: 'https://scarlet-decent-bison-643.mypinata.cloud/ipfs/bafkreiaaf2kqfnajqk........',
    isTicketScanned: false,
    signature: '012701644dcfcf3393a83bc83a4df2d7'
}

In order to verify the signature for this scenario, your ordered base string must look like this:

eventid1eventnametestisticketscannedfalsenft_urlhttps://scarlet-decent-bison-643.mypinata.cloud/ipfs/bafkreiaaf2kqfnajqk........one_ticket_id678d34fecd......owner0x77f971d3db2639a2......keysignature_key

End point 3: Scan Ticket

  1. This endpoint strictly validates incoming data. Ensure your request matches the specified schema and does not include any additional fields.
  2. Use the one_ticket_id field provided during the generation process as the ticket_id.
Request : POST | https://sandbox.one-ticket.fr/api/scan_ticket
{
    ticket_id: "678d34fecd......",
}

You should apply the Security Protocol to generate a valid signature using your signature key.

{
    ticket_id: "678d34fecd......",
    signature: "8a061333cb92.........."
}

Request data should be encrypted using the crypt key before being sent to the endpoint. Refer to the Security Protocol for additional information.

{
    data: "encryptedData",
    token: "token"
}
Response

Our server always responds with encrypted data using the same Security Protocol.

{
    data: "U2FsdGVkX19sfk7pwxKxg7o69ryadttAgimmhIrnTOYMp+mtM1oaT6IODYemRLSpjA7ilQrkI9+gPZailfxMU05ODgD0GTmpthi+Wyn5Eft0RnzribSSbWLpHHh/pDabBgQkuj2LT6P1vtn+tizTcTRs6pTy8m2YyUN58pDleDV35JUFNCIPNXnIhW4pYEfDuW7K7cNNmFPAl9mPPvT5NtEJprkJKGbziONhFO9hL8JzttavngER3Ixlu14EWMrw2H2rkwgY1g8C5eMUp3uZ7kYiW5QwVpvHWPVqxg4nhVqxlNKDL7IaR/vobTB77H71ZCcfB8VIE3ewE/DAxyIt1lm+7g7U3695rP/+L2tIlFqW01ZcCF1ZjLctNvb42AxUAlpdJSspqRfsW5eaJYB2uLAafdqcbK/j5SKIUss/EYlaKE2eHRoIxYU1uv/HHdPZDP3sdy6VIXNGHMsHskgSGKELPObkC7Xr6GauMEsjlyGm7VHTECdhr7Xl7OJAD8ZjY0+vm685u/nQhgFm0o9xw4l52MK0wLKjk1Szyu2n3Sf6nqC6CEmfgV2akG+eDmDX",
}
  1. Decrypt the response using your crypt key.
  2. For maximum security, we strongly recommend verifying the signature using the same Security Protocol to ensure the response is from our servers.
{
    ticket: {
      one_ticket_id: '678d34fecd......',
      eventID: '1',
      eventName: 'test',
      owner: '0x77F971D3DB2639a2......',
      nft_url: 'https://scarlet-decent-bison-643.mypinata.cloud/ipfs/bafkreiaaf2kqfnajqk........',
      isTicketScanned: true
    },
    memory_ticket: {
      contrat_address: '0x2d658d532C9c87......',
      ticket_id: '2'
    },
    signature: '22ffb86d55d27b57df63ed400136b3e8'
  }

In order to verify the signature for this scenario, your ordered base string must look like this:

memory_ticketcontrat_address0x2d658d532C9c87......ticket_id2tiketeventid1eventnamee1isticketscannedtruenft_urlhttps://scarlet-decent-bison-643.mypinata.cloud/ipfs/bafkreiaaf2kqfnajqk........one_ticket_id678d34fecd......owner0x77F971D3DB2639a2......keysignature_key

End point 4: transfer Ticket

  1. This endpoint strictly validates incoming data. Ensure your request matches the specified schema and does not include any additional fields.
  2. If the recipient user does not exist, this endpoint will automatically create the user. No additional processing is required from your side.
  3. Use the one_ticket_id field provided during the generation process as the ticket_id.
Request : POST | https://sandbox.one-ticket.fr/api/transfer_ticket
{
    ticket_id: "678d34fecd......",
    sender_id: "user1",,
    reciver_id: "user2",
    reciver_firstname: "test",
    reciver_lastname: "test",
}

You should apply the Security Protocol to generate a valid signature using your signature key.

{
    ticket_id: "678d34fecd......",
    sender_id: "user1",,
    reciver_id: "user2",
    reciver_firstname: "test",
    reciver_lastname: "test",
    signature: "8a06b91333c2.........."
}

Request data should be encrypted using the crypt key before being sent to the endpoint. Refer to the Security Protocol for additional information.

{
    data: "encryptedData",
    token: "token"
}
Response

Our server always responds with encrypted data using the same Security Protocol.

{
    data: "U2FsdGVkX19sfk7pwxKxg7o69ryadttAgimmhIrnTOYMp+mtM1oaT6IODYemRLSpjA7ilQrkI9+gPZailfxMU05ODgD0GTmpthi+Wyn5Eft0RnzribSSbWLpHHh/pDabBgQkuj2LT6P1vtn+tizTcTRs6pTy8m2YyUN58pDleDV35JUFNCIPNXnIhW4pYEfDuW7K7cNNmFPAl9mPPvT5NtEJprkJKGbziONhFO9hL8JzttavngER3Ixlu14EWMrw2H2rkwgY1g8C5eMUp3uZ7kYiW5QwVpvHWPVqxg4nhVqxlNKDL7IaR/vobTB77H71ZCcfB8VIE3ewE/DAxyIt1lm+7g7U3695rP/+L2tIlFqW01ZcCF1ZjLctNvb42AxUAlpdJSspqRfsW5eaJYB2uLAafdqcbK/j5SKIUss/EYlaKE2eHRoIxYU1uv/HHdPZDP3sdy6VIXNGHMsHskgSGKELPObkC7Xr6GauMEsjlyGm7VHTECdhr7Xl7OJAD8ZjY0+vm685u/nQhgFm0o9xw4l52MK0wLKjk1Szyu2n3Sf6nqC6CEmfgV2akG+eDmDX",
}
  1. Decrypt the response using your crypt key.
  2. The recipient user's private key and recovery details are only communicated once when a new user is created. Store them securely. If the user already exists, only the wallet information will be included in the response.
  3. For maximum security, we strongly recommend verifying the signature using the same Security Protocol to ensure the response is from our servers.
{
    msg: 'Ticket 678d34fecd...... successfully gifted to 0x1D8db58DeBe105......',
    sender: {
        wallet: '0x77F971D3DB2639a2......' 
    },
    reciver: {
        wallet: '0x1D8db58DeBe105......',
        private_key: '0x5b114bd6b895091da2c057......',
        recovery: 'inch there elevator........'
    },
    ticket: {
        one_ticket_id: '678d34fecd......',
        eventID: '1',
        eventName: 'test',
        owner: '0x1D8db58DeBe105......',
        nft_url: 'https://scarlet-decent-bison-643.mypinata.cloud/ipfs/bafkreiaaf2kqfnajqk........',
        isTicketScanned: false
    },
    signature: '2500548844a6b7d59b73675bcd3146c4'
}

In order to verify the signature for this scenario, your ordered base string must look like this:

msgticket678d34fecd......successfullygiftedto0x1D8db58DeBe105......reciverprivate_key0x5b114bd6b895091da2c057......recoveryinchthereelevator........wallet0x1D8db58DeBe105......senderwallet0x77F971D3DB2639a2......ticketeventid1eventnametestisticketscannedfalsenft_urlhttps://scarlet-decent-bison-643.mypinata.cloud/ipfs/bafkreiaaf2kqfnajqk........one_ticket_id678d34fecd......owner0x1D8db58DeBe105......keysignature_key

Notes

  1. Ensure all necessary security measures are followed while handling requests and responses.
  2. Store sensitive information securely and avoid sharing it publicly.
  3. Follow best practices to keep your integration secure and efficient.