less than a minute read • Updated 29 minutes ago
Build Your Own Customer Portal (Advanced)
Note that using the /s/customer endpoint is a more advanced approach. If you're not sure if you actually need to use this, please contact us to discuss your needs, as you may want to just use our "ready to go" portal front-end instead of building your own.
Working with the ''/s/customer'' endpoint
The /s/customer endpoint is a bit different than the other public-facing endpoints in Foxy. Some notes:
CORS: You must specify the domains from which your customer portal will function. This prevents certain types of attacks or unauthorized access against your users. Note that this does prevent use of certain super old browsers, but that's probably for the best.
REST: In general,
GETrequests are for retrieving (and not modifying) data.POSTis to create something new.PATCHis for modifying existing things.Do not include a body in GET requests.
Request Bodies: For
POSTandPATCH, you should submit a JSON object in the body of the request.Version Header: Pass a header of
“FOXY-API-VERSION”: “1”with your requestsSuccessful Requests: A
200status code indicates a successful request/response, and will have a JSON payload.Errors: Error responses will use the appropriate HTTP response code (ie. non-2XX or 3XX), and will generally be JSON that looks something like this:
{ "type": "authentication", "code": "422", "message": "`password` not defined or invalid." }