This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| scripting:restapi [2022/10/02 07:38] – jotasandoku | scripting:restapi [2023/11/02 14:38] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | __REST API (OR REST-API)__ | ||
| + | \\ | ||
| + | __BUILDING THE URL__ | ||
| + | \\ | ||
| + | [[https:// | ||
| + | \\ | ||
| + | * Parameters | ||
| + | * Terms | ||
| + | * Endpoint: endpoint is the whole URL. Leftside is Domain name; Rightside is URI | ||
| + | * A group of **resources** is called a **collection.** [[https:// | ||
| + | * | ||
| + | * method, headers, data(body) [[https:// | ||
| + | |||
| + | ---- | ||
| + | FILTERS: | ||
| + | |||
| + | * [[https:// | ||
| + | * Match booleans: ongoing.eq.true | ||
| + | \\ | ||
| + | * The URL above has **two parameters** separated by **&** | ||
| + | * The second parameter has **two terms** separated by ' AND ' | ||
| + | |||
| + | |||
| + | * If we are told to separate anything with Space, this is how is encoded in the URL : '' | ||
| + | * [[https:// | ||
| + | |||
| + | |||
| + | __SECURITY__ [[https:// | ||
| + | * CREDENTIALS: | ||
| + | * Token bearer | ||
| + | * Non-standard token (in the header itself): | ||
| + | * Content-Type : Content-Type | ||
| + | * X-Arbux-APIToken : xxxxxxx | ||
| + | |||
| + | __Rest API resource '' | ||
| + | \\ | ||
| + | * REST API should expose named UUID-V3 identifier. UUID should be generated from the resource logical key | ||
| + | * BACKEND should use/store numeric (ID) primary keys for its logics | ||
| + | |||
| + | |||
| + | ---- | ||
| + | |||
| * [[https:// | * [[https:// | ||
| + | * Sample domains: | ||
| + | * [[http:// | ||
| + | * [[https:// | ||
| ---- | ---- | ||
| Line 6: | Line 51: | ||
| **CURL** | **CURL** | ||
| \\ | \\ | ||
| - | **TODO: curl most common flags** | + | **TODO: curl most common flags** |
| + | * -H (header) | ||
| + | * -X (request verb to use. Example -X PUT) | ||
| \\ | \\ | ||
| **CRAFTED REQUESTS**\\ | **CRAFTED REQUESTS**\\ | ||
| Line 30: | Line 77: | ||
| Also see curl examples in [[https:// | Also see curl examples in [[https:// | ||
| - | curl --socks5 127.0.0.1: | + | curl --socks5 127.0.0.1: |
| - | + | ||
| - | ---- | + | |
| - | __BUILDING THE URL__ | + | |
| - | \\ | + | |
| - | * Parameters | + | |
| - | * Terms | + | |
| - | * Endpoint: endpoint is the whole URL. Leftside is Domain name; Rightside is URI | + | |
| - | * A group of **resources** is called a **collection.** [[https:// | + | |
| - | * | + | |
| - | * method, headers, data(body) [[https:// | + | |
| - | + | ||
| - | [[https:// | + | |
| - | \\ | + | |
| - | * The URL above has **two parameters** separated by **&** | + | |
| - | * The second parameter has **two terms** separated by ' AND ' | + | |
| - | + | ||
| - | + | ||
| - | * If we are told to separate anything with Space, this is how is encoded in the URL : '' | + | |
| - | + | ||
| - | __CREDENTIALS__ | + | |
| - | \\ | + | |
| - | * Token bearer | + | |
| - | * Non-standard token (in the header itself): | + | |
| - | * Content-Type : Content-Type | + | |
| - | * X-Arbux-APIToken : xxxxxxx | + | |
| - | + | ||
| - | __Rest API resource '' | + | |
| - | \\ | + | |
| - | * REST API should expose named UUID-V3 identifier. UUID should be generated from the resource logical key | + | |
| - | * BACKEND should use/store numeric (ID) primary keys for its logics | + | |
| ---- | ---- | ||
| Line 175: | Line 191: | ||
| \\ | \\ | ||
| - | AUTHENTICATION | + | AUTHENTICATION |
| \\ | \\ | ||
| * You need to know the authentication type to use. Basic HTTP, and OAuth are common types. | * You need to know the authentication type to use. Basic HTTP, and OAuth are common types. | ||