* **Parameters**: `userAddress`: This is a string that should contain the Ethereum address of the user. It is passed as a query parameter in the URL.
* **Purpose**: This endpoint is used to fetch the last-used nonce value for a user's Ethereum address. A nonce is a number that can only be used once, and it's typically used in cryptography to prevent replay attacks. While this endpoint provides the last-used nonce, it's recommended to use the current UTC timestamp as a nonce, where required in other endpoints.
* **200**: This is a successful HTTP response code. It means the server has successfully processed the request and returns a JSON object containing the nonce value.
* **Parameters**: The body of the request should contain a JSON object with the following properties:
*`did`: This is a string representing the Decentralized Identifier (DID) of the dataset.
*`serviceId`: This is a string representing the ID of the service.
* **Purpose**: This endpoint is used to retrieve the `Content-Type` and `Content-Length` from a given URL or asset. For published assets, `did` and `serviceId` should be provided. It also accepts file objects (as described in the Ocean Protocol documentation) and can compute a checksum if the file size is less than `MAX_CHECKSUM_LENGTH`. For larger files, the checksum will not be computed.
1. You need to set up and connect a wallet for the consumer. The consumer needs to have purchased the datatoken for the asset that you are trying to download. Libraries such as ocean.js or ocean.py can be used for this.
2. Get the nonce. This can be done by calling the `/getnonce` endpoint above.
The datatoken is transferred on the blockchain by requesting the user to sign an ERC20 approval transaction where the approval is given to the provider's account for the number of tokens required by the service.
* **Parameters**: The query parameters for this endpoint should contain the following properties:
*`documentId`: A string containing the document id (e.g., a DID).
*`serviceId`: A string representing the ID of the service the data token is attached to.
*`consumerAddress`: A string containing the consumer's Ethereum address.
*`environment`: A string representing a compute environment offered by the provider.
*`validUntil`: An integer representing the date of validity of the service (optional).
*`fileIndex`: An integer representing the index of the file from the files list in the dataset. If set, the provider will validate the file access (optional).
* **Purpose**: This endpoint is used to initialize a service and return a quote for the number of tokens to transfer to the provider's account.
* **Responses**:
* **200**: This is a successful HTTP response code. It returns a JSON object containing information about the quote for tokens to be transferred.