> For the complete documentation index, see [llms.txt](https://help.openloyalty.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.openloyalty.io/api-reference/campaign/get-members-ranking-in-a-specific-campaign.md).

# Get member's ranking in a specific campaign

Integration\
\
This method returns detailed information about a member's ranking in a specific campaign, including surrounding members.\ <br>

````json
{"openapi":"3.0.0","info":{"title":"Open Loyalty","version":"0.0.1"},"tags":[{"name":"Campaign","description":"These endpoints will allow you to easily manage campaigns."}],"servers":[{"url":"http://openloyalty.localhost"}],"security":[{"Bearer":[]},{"token":[]}],"components":{"securitySchemes":{"Bearer":{"type":"http","description":"Open Loyalty has the JWT authorization.\nTo learn what a JSON Web Token is and how it works, check out Introduction to JSON Web Tokens <https://jwt.io/introduction/>\n\n### Obtain an access token\n\nSend a request with the parameters username and password\n\n#### Definition\n\n`POST /api/admin/login_check` [Go to definition](#operation/adminLoginCheck)\\\n`POST /api/{storeCode}/member/login_check` [Go to definition](#operation/memberLoginCheck)\n\n#### Example\n\n```bash\ncurl {HOST}/api/admin/login_check\n    -H 'Content-Type: application/json;charset=UTF-8'\n    -H 'Accept: application/json, text/plain, */*'\n    --data-binary '{\"username\":\"admin\",\"password\":\"password\"}'\n```\n\n#### Example Response\n\n```json\n{\n    \"token\":\"eyJhbGciOiJSUzI1NiIsInR5cCI6...\",\n    \"refresh_token\":\"0558f8bb29948c4e54c443f...\"\n}\n```\n\n### Using JSON Web Token\n\nAdd authorization header to each request\\\n`Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6...`\\\nYou can now access any API method you want under the /api prefix.\n\n#### Example\n```bash\ncurl {HOST}/api/{storeCode}/analytics/members\n    -H 'Accept: application/json'\n    -H 'Content-type: application/x-www-form-urlencoded'\n    -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6...'\n```\n\n### Refresh JSON Web Token\nYou can refresh token using refresh_token that was given during login.\\\nThere are two endpoints\\\nTo refresh admin token `POST /api/token/refresh` [Go to definition](#operation/tokenRefresh)\\\nTo refresh member token `POST /api/{storeCode}/token/refresh` [Go to definition](#operation/tokenRefreshMember)\n","bearerFormat":"JWT","scheme":"bearer"},"token":{"type":"apiKey","name":"X-AUTH-TOKEN","in":"header"}},"parameters":{"storeCode":{"name":"storeCode","in":"path","description":"Store code","required":true,"schema":{"type":"string"}},"campaign":{"name":"campaign","in":"path","description":"Campaign ID","required":true,"schema":{"type":"string","format":"uuid"}}},"responses":{"Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"}}}},"AccessDenied":{"description":"Forbidden.","content":{"application/json":{"schema":{"required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"}}}},"NotFound":{"description":"Not found.","content":{"application/json":{"schema":{"required":["code","message"],"properties":{"code":{"type":"integer"},"message":{"type":"string"}},"type":"object"}}}}}},"paths":{"/api/{storeCode}/campaign/{campaign}/leaderboard/member/{member}":{"get":{"tags":["Campaign"],"summary":"Get member's ranking in a specific campaign","description":"<label style=\"background-color: #BFE1F6;padding:5px;\">Integration</label><br><br>\nThis method returns detailed information about a member's ranking in a specific campaign, including surrounding members.<br><br>\n","operationId":"campaignMemberLeaderboardGet","parameters":[{"$ref":"#/components/parameters/storeCode"},{"$ref":"#/components/parameters/campaign"},{"name":"member","in":"path","description":"Member identifier (UUID)","required":true,"schema":{"type":"string","format":"uuid"}},{"name":"type","in":"query","description":"The type of cycle for which the ranking is to be returned.","required":false,"style":"deepObject","explode":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Member's ranking details with surrounding members.","content":{"application/json":{"schema":{"properties":{"groupValue":{"description":"Group label the member is ranked under for grouped leaderboards (e.g. the city or custom attribute value). Empty string for non-grouped leaderboards. Members with no resolvable group value on a grouped leaderboard are not found here (404).\n","type":"string"},"score":{"description":"Member's score in the campaign","type":"number","format":"float"},"recalculatedAt":{"description":"When the position was last recalculated","type":"string","format":"date-time"},"position":{"description":"Current position in the leaderboard","type":"integer"},"changedPositionAt":{"description":"When the position changed or initial date","type":"string","format":"date-time"},"progress":{"properties":{"general":{"description":"Position change since the beginning of the leaderboard","type":"integer"},"recalculated":{"description":"Position change since the last recalculation","type":"integer"},"period":{"description":"Position change since the last reset","type":"integer"}},"type":"object"},"surrounding":{"properties":{"higher":{"description":"Members ranked higher than the current member","type":"array","items":{"properties":{"member":{"properties":{"customerId":{"type":"string","format":"uuid"},"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string","format":"email"},"phone":{"type":"string"},"loyaltyCardNumber":{"type":"string"}},"type":"object"},"ranking":{"properties":{"score":{"description":"Member's score in the campaign","type":"number","format":"float"},"recalculatedAt":{"description":"When the position was last recalculated","type":"string","format":"date-time"},"position":{"description":"Current position in the leaderboard","type":"integer"},"changedPositionAt":{"description":"When the position changed or initial date","type":"string","format":"date-time"},"progress":{"properties":{"general":{"description":"Position change since the beginning of the leaderboard","type":"integer"},"recalculated":{"description":"Position change since the last recalculation","type":"integer"},"period":{"description":"Position change since the last reset","type":"integer"}},"type":"object"}},"type":"object"}},"type":"object"}},"lower":{"description":"Members ranked lower than the current member","type":"array","items":{"properties":{"member":{"properties":{"customerId":{"type":"string","format":"uuid"},"firstName":{"type":"string"},"lastName":{"type":"string"},"email":{"type":"string","format":"email"},"phone":{"type":"string"},"loyaltyCardNumber":{"type":"string"}},"type":"object"},"ranking":{"properties":{"score":{"description":"Member's score in the campaign","type":"number","format":"float"},"recalculatedAt":{"description":"When the position was last recalculated","type":"string","format":"date-time"},"position":{"description":"Current position in the leaderboard","type":"integer"},"changedPositionAt":{"description":"When the position changed or initial date","type":"string","format":"date-time"},"progress":{"properties":{"general":{"description":"Position change since the beginning of the leaderboard","type":"integer"},"recalculated":{"description":"Position change since the last recalculation","type":"integer"},"period":{"description":"Position change since the last reset","type":"integer"}},"type":"object"}},"type":"object"}},"type":"object"}}},"type":"object"}},"type":"object"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/AccessDenied"},"404":{"$ref":"#/components/responses/NotFound"}}}}}}
````


---

# 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://help.openloyalty.io/api-reference/campaign/get-members-ranking-in-a-specific-campaign.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.
