# Lib Developers

{% hint style="info" %}
This page is only for library developers.\
API users need to use the endpoints listed in the sidebar.
{% endhint %}

Here is what an API client lib should look like.

The http client should always include an `Authorization` header for every request and an optional header for `User-Agent` to show the library name or project/bot name.

![](https://3672136931-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FW0dwcUm6OW6GS8mkEbZT%2Fuploads%2F9Hd1oibfXNvToqxJIaTd%2Fimage.png?alt=media\&token=60929be3-4739-48a6-8d11-11bee692418d)\
The base class should be FluxpointClient with a category for each types of endpoints to use.\
So this should be used by users like `Client.Test.GetTestImage()` or `Client.Sfw.GetNeko()`\
\
You should also include a TestAuthentication() method so the user can check if they are authenticated properly.

### Send Request Method

You should create a main SendRequest() method that can be used for all endpoints.\
![](https://3672136931-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FW0dwcUm6OW6GS8mkEbZT%2Fuploads%2F8kBitMWR3rm64hRDIKLP%2Fimage.png?alt=media\&token=01ec68c6-c29d-46b8-8644-782f5c964305)\
This will include the HttpMethod (get/post) ApiType (Fluxpoint/Gallery) Path (Endpoint to use) Content (Optional body content this should include string/json support.\
\
The output response you recieve should include the default response of success, code and message and any optional data from the endpoint you use.

### Image Gen Method

This should be the same as Send Request but the response you get will contain raw image data (bytes) that you should handle.

{% hint style="info" %}
Some http clients/libs may require sending a <mark style="color:yellow;">POST</mark> request to use json body.
{% endhint %}

### Endpoints

All endpoints need to have a category so that users can find them easily.\
\
You can use the `SendRequest()` method to send a <mark style="color:green;">GET</mark> request to `https://api.fluxpoint.dev/me`\
![](https://3672136931-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FW0dwcUm6OW6GS8mkEbZT%2Fuploads%2FE9ThkIgRqLLkRUs3wd39%2Fimage.png?alt=media\&token=2003820e-f815-491b-91f6-7c6737f96015)\
Users should then be able to use this with `Client.Misc.GetMeAsync()`
