> For the complete documentation index, see [llms.txt](https://docs.fyre.hypersign.id/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fyre.hypersign.id/developer/apis/app-user-redirection.md).

# /app/user/redirection

This API is for letting user to participate in Fyre event right from their user interface.

**URL**

* Prod: <https://api.fyre.hypersign.id/ext/api/v1/app/user/redirection>
* Stage: [https://stage.hypermine.in/whitelist/ext/api/v1/app/user/redirection](https://stage.hypermine.in/whitelist/ext/api/v1/app/user/redirection\\)

#### Method

POST

**Headers**

```
"Content-Type": 'application/json',
"Origin": <base URL> // Registered Base URl 
```

#### Request Body

Every request body must contain three properties: `message`, `fyresign` and `messageHash`.

**Request Body**

```javascript
{ 
 "message":{
    "appId": "6274a30fc43e35144642a484",  
     "externalUserId": "456fhrghtuht374",   
     "eventId": "6274b4cde7556226721e620c", 
     "isEmail": false, 
     "iat": 1651816302,
     "exp": 1651902702
  },
"fyresign":"0x5c25457adff5385cd037348a8c6dc3522251f31bb253c9add3636326629bc5702c5f0a496029b4ace1efe6a089df7c376d7de3c10348d6ec4b99288c8e9b3ec01c",
 "messageHash":"0x45f4b3743aad31ac28961666ee06d4930456995699f16d6a2ae17a318390da0f"
}
```

* **message**
  * **appId**: Id that you will get after creating app in Fyre platform.
  * **externalUserId**: Identifier for the user on application's platform which will be mapped with Fyre user Id.
  * **iat**: Timestamp at which the message was signed.
  * **exp**: Timestamp upto which the signature is valid.
  * **isEmail**: This is to identify whether application's user identifier is email or not
  * **metaData**: This field is to send extra parameter like `limit`, `page` values.
* **fyresign**: Signature generated by signing `message` using app's private key. Send generated signature in this field.
* **messageHash**: hash of the message.

> **Note:** If an application's user identifier is an email, then the user need not to login again at Fyre event form otherwise they do have to login again at Fyre end and that user id (or externalUserId) will be mapped with Fyre userId.

#### Response Body

Sample reponse:

```javascript
{
  "message": "Access Granted",
  "data": {
    "userRedirectionToken ": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6IjYyNzYzODcwNDBkYzQwMTRiYWM5ODVkNyIsImV4dGVybmFsVXNlcklkIjoiNDU2ZmhyZ2hmbmduanR1aHQzNzQiLCJpc0VtYWlsIjpmYWxzZSwidG9rZW5UeXBlIjoiVXNlclJlZGlyZWN0aW9uQWNjZXNzIiwiaWF0IjoxNjUyMDc0NDE2LCJleHAiOjE2NTIxNjA4MTZ9.vB01It3ZcOVkEAeRUbKPT_x26GofiS5mn3Rj1Q30MGM"
  },
  "success": true,
  "error": false
}
```

**userRedirectionToken**

Use this token in a query parameter `userRedirectionToken` in the event form URL. This is to ensure the user is coming from right application and also to map application user to the Fyre platform user.

Sample event from URL:

`https://app.fyre.hypersign.id/form/test-event?userRedirectionToken=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBJZCI6IjYyNzYzODcwNDBkYzQwMTRiYWM5ODVkNyIsImV4dGVybmFsVXNlcklkIjoiNDU2ZmhyZ2hmbmduanR1aHQzNzQiLCJpc0VtYWlsIjpmYWxzZSwidG9rZW5UeXBlIjoiVXNlclJlZGlyZWN0aW9uQWNjZXNzIiwiaWF0IjoxNjUyMDc0NDE2LCJleHAiOjE2NTIxNjA4MTZ9.vB01It3ZcOVkEAeRUbKPT_x26GofiS5mn3Rj1Q30MGM`&#x20;

Developer can read the next section to know about available error codes.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.fyre.hypersign.id/developer/apis/app-user-redirection.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
