Shad Event Service API Documentation
Introduction
The Shad Event Service is designed and implemented to facilitate the management and participation of users in events related to cultural, social, and educational activities. This service enables the redirection of Shad users to the event platform without the need for repeated authentication, ensuring a seamless experience for participants.
To use this service, the event organizer must obtain the required permissions and configure the event settings in the Shad system. Once configured, the event can be displayed in the Shad application, allowing users to access the event through a specified link.
Event Configuration
To configure an event, the following information is required:
Event ID, Username, and Password
- This information is needed for event organizers to authenticate users. The details will be provided by the Shad operations team.
Connection Link
- The event organizer needs to provide a redirection link to guide Shad users to the event’s specific page.
- The link should be structured as a QueryString parameter using the
UserIDvalue as follows:
Example:
https://mysite.ir/shad?UserID=D4-76-29-46-BA-E1-88-74-C1-51-89-2A-D1-A8-58-C0In this example, the UserID parameter is the identifier of the user in Shad.
Methods
Login Method
This method is used to authenticate the event organizer and retrieve a token for further interactions.
URL
https://shadapi.noyanet.com/api/v1/Account/loginInput Parameters
Parameter Type Mandatory Description landingIdintYes Unique identifier for the event. usernamestringYes The username provided for the event. passwordstringYes The password provided for the event. Example Request
bashcurl -X 'POST' \ 'https://shadapi.noyanet.com/api/v1/Account/login' \ -H 'accept: text/plain' \ -H 'Content-Type: application/json' \ -d '{ "landingId": [your landingId], "username": "[your username]", "password": "[your password]" }'Response Example
json{ "data": "[Token]", "success": true, "statusCode": "OK", "code": 200, "description": "با موفقیت انجام شد" }
ShadEvent Method
This method is used to retrieve the user's information after successful authentication.
URL:
https://shadapi.noyanet.com/api/v1/ShadEvent?UserHashId=[your userId]Input Parameters:
Parameter Type Mandatory Description TokenstringYes The token received from the Loginmethod in the header.UserHashIdstringYes The unique identifier of the user. Example Request:
bashcurl -X 'GET' \ 'https://shadapi.noyanet.com/api/v1/ShadEvent?UserHashId=[your userId]' \ -H 'accept: text/plain' \ -H 'Authorization: Bearer [token]'Response Example for an authenticated user:
json{ "data": { "id": 516222, "nationalId": null, "hashedId": "C3-A4-F5-C2-27-14-D9-56-A6-A0-AE-90-3A-E0-CF-2E", "name": "رونيكا", "family": "نادم كچائي", "event": null, "provinceName": "گیلان", "mobile": "989226670378", "courseStudy": "دوره ابتدایی توصیفی", "districtName": "1رشت .ناحیه", "fundamentalId": 3, "role": "student" }, "success": true, "statusCode": 200, "code": 200, "description": "با موفقیت انجام شد" }Response Example for an unauthenticated user:
json{ "data": { "id": 516223, "nationalId": null, "hashedId": "E7-17-70-D6-D0-37-26-FE-4F-74-A7-ED-89-23-46-FC", "name": null, "family": null, "event": null, "provinceName": null, "mobile": "989388332389", "courseStudy": null, "districtName": null, "fundamentalId": null, "role": null }, "success": true, "statusCode": 200, "code": 200, "description": "با موفقیت انجام شد" }
GetUserInfoByApiKey Method
This method is used to retrieve user information using an apiKey instead of an authorization token. It functions similarly to the ShadEvent method but skips the authentication step, requiring only the apiKey for access.
URL:
https://shadapi.noyanet.com/api/v1/GetUserInfoByApiKey?EventId=[your event id]&UserHashId=[your userId]Input Parameters:
Parameter Type Mandatory Description apiKeystringYes (Header) The API key to authenticate the request. EventIdint64Yes The unique identifier of the event. UserHashIdstringYes The unique identifier of the user. Response Example:
json{ "statusCode": "Continue", "code": 0, "description": "string", "success": true, "data": { "id": 0, "nationalId": "string", "uniqueNumber": "string", "shadIdentifie": "string", "hashedId": "string", "name": "string", "family": "string", "event": "string", "provinceName": "string", "mobile": "string", "courseStudy": "string", "fieldStudy": "string", "districtName": "string", "fundamentalId": 0, "role": "string", "gender": "Male", "roleType": "manager" } }
Notes
- Unlike the
ShadEventmethod, this endpoint does not require an authorization token. Instead, it uses theapiKeypassed as a header for authentication. - The endpoint returns the same data structure as the
ShadEventmethod.
Event Workflow
The following steps outline the event workflow for a Shad user:
- User clicks on the event link in the Shad application.
- The user is redirected to the specified connection link (
UserIDis passed as a parameter). - The event organizer authenticates using the
Loginmethod and retrieves a token. - The organizer uses the
ShadEventmethod with the token andUserIDto fetch user information and update the event platform.
Version: 2024, November
Publisher: ShadNoyan Network Technology Company