# CustomID Encoding for GET requests

**URL:** <https://discuss.jsonapi.org/t/customid-encoding-for-get-requests/2436>\
**Category:** Uncategorized\
**Created:** [May 4, 2022, 4:23pm UTC](https://discuss.jsonapi.org/t/customid-encoding-for-get-requests/2436 "2022-05-04T16:23:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kojho](https://avatars.discourse-cdn.com/v4/letter/k/5f8ce5/32.png) [@kojho](https://discuss.jsonapi.org/u/kojho)\
**Post date:** [May 4, 2022, 4:23pm UTC](https://discuss.jsonapi.org/t/customid-encoding-for-get-requests/2436/1 "2022-05-04T16:23:14Z")

</div>

I have several tables that do not use integers as primary keys, but instead use a 2-4 letter string/code. Currently, making a GET request to the resource throws an error only for the resources that use codes. My tables that do use integers as primary keys work perfectly fine.  
eg:  
GET url/resource/123 returns 200  
GET url/resource/ABC returns 404

> **[Identifier | Laravel JSON:API](https://laraveljsonapi.io/docs/2.0/schemas/identifier.html#custom-id-encoding)**
>
> Build JSON:API compliant APIs in Laravel.

I see that the laravel JSONAPI docs mention a section on CustomID encoding, but dont offer any explanation for what that means. I am trying to figure out what I need to do to be able to perform a GET request using the string primary key for my resources. I have set the `model` and `uriType` attributes correctly in the schema, as well as the `primaryKey` and `keyType` attributes in the model.

---

<div class="post-metadata">

**Author:** ![jelhan](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.jsonapi.org/jelhan/32/822_2.png) [@jelhan](https://discuss.jsonapi.org/u/jelhan)\
**Post date:** [July 13, 2022, 7:13pm UTC](https://discuss.jsonapi.org/t/customid-encoding-for-get-requests/2436/2 "2022-07-13T19:13:20Z")

</div>

Hello kojho,

This forum is about the JSON:API specification itself. Question about specific implementations are better asked at other places like StackOverflow and forums or chats used by the specific implementation. For Laravel JSON:API the Slack of that project might be a good alternative to StackOverflow.

Best  
Jeldrik
