From 2ead2e47f141fc88432364f4ef9453d3c757b4ed Mon Sep 17 00:00:00 2001 From: Paul Grimes Date: Thu, 5 Sep 2024 20:38:09 +1000 Subject: [PATCH] Feature: JWT authenticated security --- .env.testing | 9 +- app/Console/Commands/TestCommand.php | 45 +- app/Enums/ApiResponse.php | 25 +- ...dminUserPersonalAccessTokensController.php | 6 +- .../Api/V1/ApiMyTeamAuditItemsController.php | 68 +- .../Api/V1/ApiMyTeamController.php | 6 +- .../Api/V1/ApiMyTeamVouchersController.php | 4 +- .../Api/V1/ApiMyTeamsController.php | 4 +- .../Controllers/Api/V1/ApiShopsController.php | 4 +- .../Api/V1/ApiSystemStatisticsController.php | 4 +- .../Middleware/VerifyApiTokenSignature.php | 133 + app/Models/PersonalAccessToken.php | 1 + app/Models/User.php | 43 + app/Services/PersonalAccessTokenService.php | 38 + composer.json | 1 + composer.lock | 297 +- config/scribe.php | 162 +- ...16_create_personal_access_tokens_table.php | 1 + package-lock.json | 338 +- resources/css/app.css | 4 +- resources/js/Pages/Admin/Users/User.vue | 8 +- resources/views/scribe/index.blade.php | 16146 ++++++++++++++-- routes/api.php | 18 +- tests/Feature/API/BaseAPITestCase.php | 41 +- .../API/ExternalRequestsMustBeSignedTest.php | 84 + 25 files changed, 15663 insertions(+), 1827 deletions(-) create mode 100644 app/Http/Middleware/VerifyApiTokenSignature.php create mode 100644 app/Services/PersonalAccessTokenService.php create mode 100644 tests/Feature/API/ExternalRequestsMustBeSignedTest.php diff --git a/.env.testing b/.env.testing index 0104f4b..54d0faf 100644 --- a/.env.testing +++ b/.env.testing @@ -3,8 +3,8 @@ APP_ENV=testing APP_KEY=base64:E/+xI5BYR6yy+PoKz6nv60FVET0yEcmB0d+bjDM4X2E= APP_DEBUG=true APP_TIMEZONE=UTC -APP_URL=http://vine.test -APP_PRODUCTION_URL=http://vine.test +APP_URL=https://vine.test +APP_PRODUCTION_URL=https://vine.test APP_LOCALE=en APP_FALLBACK_LOCALE=en @@ -31,9 +31,8 @@ SESSION_DRIVER=file SESSION_LIFETIME=120 SESSION_ENCRYPT=false SESSION_PATH=/ -SESSION_DOMAIN=open-food-network-vouchers - -SANCTUM_STATEFUL_DOMAINS=open-food-network-vouchers.test +SESSION_DOMAIN=vine.test +SANCTUM_STATEFUL_DOMAINS=vine.test BROADCAST_CONNECTION=log FILESYSTEM_DISK=local diff --git a/app/Console/Commands/TestCommand.php b/app/Console/Commands/TestCommand.php index 35b8e1c..ecdcff1 100644 --- a/app/Console/Commands/TestCommand.php +++ b/app/Console/Commands/TestCommand.php @@ -3,11 +3,18 @@ namespace App\Console\Commands; use App\Models\AuditItem; +use App\Models\PersonalAccessToken; use App\Models\Team; use App\Models\User; use App\Models\Voucher; use App\Models\VoucherSet; +use App\Services\PersonalAccessTokenService; use Illuminate\Console\Command; +use Lcobucci\JWT\Encoding\ChainedFormatter; +use Lcobucci\JWT\Encoding\JoseEncoder; +use Lcobucci\JWT\Signer\Key\InMemory; +use Lcobucci\JWT\Signer\Hmac\Sha256; +use Lcobucci\JWT\Token\Builder; class TestCommand extends Command { @@ -30,12 +37,36 @@ class TestCommand extends Command */ public function handle() { - $users = User::factory(100)->createQuietly(); - $teams = Team::factory(100)->createQuietly(); - $vouchers = Voucher::factory(100)->createQuietly(); - $voucherSets = VoucherSet::factory(100)->createQuietly(); - $auditItems = AuditItem::factory(100)->createQuietly([ - 'team_id' => 1, - ]); + $model = PersonalAccessToken::find(5); + $jwt = PersonalAccessTokenService::generateJwtForPersonalAccessToken($model); + dd($jwt); + $tokenBuilder = (new Builder(new JoseEncoder(), ChainedFormatter::default())); + $algorithm = new Sha256(); + $signingKey = InMemory::plainText('BC0HYlfCbvFcn3BqbcwGkOdTOVilkdn3'); + + $now = new \DateTimeImmutable(); + $token = $tokenBuilder + // Configures the issuer (iss claim) + ->issuedBy(env('APP_URL')) + // Configures the audience (aud claim) +// ->permittedFor('http://example.org') + // Configures the subject of the token (sub claim) +// ->relatedTo('component1') + // Configures the id (jti claim) +// ->identifiedBy('4f1g23a12aa') + // Configures the time that the token was issue (iat claim) + ->issuedAt($now) + // Configures the time that the token can be used (nbf claim) +// ->canOnlyBeUsedAfter($now->modify('+1 minute')) + // Configures the expiration time of the token (exp claim) + ->expiresAt($now->modify('+1 hour')) + // Configures a new claim, called "uid" +// ->withClaim('uid', 1) + // Configures a new header, called "foo" +// ->withHeader('foo', 'bar') + // Builds a new token + ->getToken($algorithm, $signingKey); + + echo $token->toString(); } } diff --git a/app/Enums/ApiResponse.php b/app/Enums/ApiResponse.php index 150d5a5..b974818 100644 --- a/app/Enums/ApiResponse.php +++ b/app/Enums/ApiResponse.php @@ -7,13 +7,20 @@ */ enum ApiResponse: string { - case RESPONSE_DELETED = 'Deleted'; - case RESPONSE_ERROR = 'Error'; - case RESPONSE_METHOD_NOT_ALLOWED = 'Method Not Allowed'; - case RESPONSE_NOT_FOUND = 'Not found'; - case RESPONSE_OK = 'OK'; - case RESPONSE_SAVED = 'Saved'; - case RESPONSE_TOKEN_NOT_ALLOWED_TO_DO_THIS = 'Token not allowed to do this.'; - case RESPONSE_QUERY_FILTER_DISALLOWED = 'Query filter disallowed'; - case RESPONSE_UPDATED = 'Updated'; + case RESPONSE_DELETED = 'Deleted'; + case RESPONSE_ERROR = 'Error'; + case RESPONSE_METHOD_NOT_ALLOWED = 'Method Not Allowed'; + case RESPONSE_NOT_FOUND = 'Not found'; + case RESPONSE_OK = 'OK'; + case RESPONSE_SAVED = 'Saved'; + case RESPONSE_TOKEN_NOT_ALLOWED_TO_DO_THIS = 'Token not allowed to do this.'; + case RESPONSE_AUTHORIZATION_SIGNATURE_INCORRECT = 'Incorrect authorization signature.'; + case RESPONSE_AUTHORIZATION_SIGNATURE_INCORRECT_JWT_HEADER_REQUIRED = 'JWT Authorization header required.'; + case RESPONSE_AUTHORIZATION_SIGNATURE_INCORRECT_IAT_CLAIM_REQUIRED = 'IAT claim required.'; + case RESPONSE_AUTHORIZATION_SIGNATURE_INCORRECT_EXP_CLAIM_REQUIRED = 'EXP claim required.'; + case RESPONSE_AUTHORIZATION_SIGNATURE_INCORRECT_IAT_EXPIRED = 'IAT claim expired.'; + case RESPONSE_AUTHORIZATION_SIGNATURE_INCORRECT_IAT_EXP_TOO_LARGE = 'IAT and EXP too far apart. Max diff: 1 minute.'; + case RESPONSE_AUTHORIZATION_SIGNATURE_INCORRECT_EXPIRED = 'Token expired.'; + case RESPONSE_QUERY_FILTER_DISALLOWED = 'Query filter disallowed'; + case RESPONSE_UPDATED = 'Updated'; } diff --git a/app/Http/Controllers/Api/V1/Admin/ApiAdminUserPersonalAccessTokensController.php b/app/Http/Controllers/Api/V1/Admin/ApiAdminUserPersonalAccessTokensController.php index a8f65e0..9ea90aa 100644 --- a/app/Http/Controllers/Api/V1/Admin/ApiAdminUserPersonalAccessTokensController.php +++ b/app/Http/Controllers/Api/V1/Admin/ApiAdminUserPersonalAccessTokensController.php @@ -16,6 +16,7 @@ use App\Models\User; use Exception; use Illuminate\Http\JsonResponse; +use Illuminate\Support\Facades\Crypt; use Illuminate\Support\Facades\Validator; use Illuminate\Validation\Rule; @@ -103,7 +104,10 @@ public function store(): JsonResponse $token = $user->createToken($name, $tokenAbilities); $this->message = ApiResponse::RESPONSE_SAVED->value; - $this->data = ['token' => $token->plainTextToken]; + $this->data = [ + 'token' => $token->plainTextToken, + 'secret' => Crypt::decrypt($token->accessToken->secret), + ]; event(new PersonalAccessTokenWasCreated($token->accessToken)); diff --git a/app/Http/Controllers/Api/V1/ApiMyTeamAuditItemsController.php b/app/Http/Controllers/Api/V1/ApiMyTeamAuditItemsController.php index b61a7c9..8b1a114 100644 --- a/app/Http/Controllers/Api/V1/ApiMyTeamAuditItemsController.php +++ b/app/Http/Controllers/Api/V1/ApiMyTeamAuditItemsController.php @@ -7,9 +7,18 @@ use App\Http\Controllers\Api\HandlesAPIRequests; use App\Http\Controllers\Controller; use App\Models\AuditItem; -use Auth; use Illuminate\Http\JsonResponse; +use Illuminate\Support\Facades\Auth; +use Knuckles\Scribe\Attributes\Authenticated; +use Knuckles\Scribe\Attributes\Endpoint; +use Knuckles\Scribe\Attributes\Group; +use Knuckles\Scribe\Attributes\QueryParam; +use Knuckles\Scribe\Attributes\Response; +use Knuckles\Scribe\Attributes\Subgroup; +use Knuckles\Scribe\Attributes\UrlParam; +#[Group('App Endpoints')] +#[Subgroup('/my-team-audit-items', 'Retrieve your team audit trail.')] class ApiMyTeamAuditItemsController extends Controller { use HandlesAPIRequests; @@ -32,6 +41,31 @@ class ApiMyTeamAuditItemsController extends Controller * * @throws DisallowedApiFieldException */ + #[Endpoint( + title : 'GET /', + description : 'Retrieve your audit items. Automatically filtered to your current team.', + authenticated: true + )] + #[Authenticated] + #[QueryParam( + name : 'cached', + type : 'bool', + description: 'Request the response to be cached. Default: `true`.', + required : false, + example : true + )] + #[QueryParam( + name : 'fields', + type : 'string', + description: 'Comma-separated list of database fields to return within the object.', + required : false, + example : 'id,created_at' + )] + #[Response( + content : '{"meta": {"responseCode": 200, "limit": 50, "offset": 0, "message": "", "cached": false, "availableRelations": []}, "data": {"current_page": 1, "data": {"id": 1, "name": "Team A", "created_at": "2024-08-16T06:54:28.000000Z", "updated_at": "2024-08-16T06:54:28.000000Z", "deleted_at": null}], "first_page_url": "https:\/\/vine.openfoodnetwork.org.au\/api\/v1\/my-team-audit-items?page=1", "from": 1, "last_page": 1, "last_page_url": "https:\/\/vine.openfoodnetwork.org.au\/api\/v1\/my-team-audit-items?page=1", "links": [{"url": null, "label": "« Previous", "active": false}, {"url": "https:\/\/vine.openfoodnetwork.org.au\/api\/v1\/my-team-audit-items?page=1", "label": "1", "active": true}, {"url": null, "label": "Next »", "active": false}], "next_page_url": null, "path": "https:\/\/vine.openfoodnetwork.org.au\/api\/v1\/my-team-audit-items", "per_page": 50, "prev_page_url": null, "to": 2, "total": 2}}', + status : 200, + description: '' + )] public function index(): JsonResponse { $this->query = AuditItem::where('auditable_team_id', Auth::user()->current_team_id)->with($this->associatedData); @@ -43,7 +77,7 @@ public function index(): JsonResponse /** * POST / - * + * @hideFromAPIDocumentation * @return JsonResponse */ public function store(): JsonResponse @@ -63,6 +97,32 @@ public function store(): JsonResponse * * @throws DisallowedApiFieldException */ + #[Endpoint( + title : 'GET /{id}', + description : 'Retrieve a single audit item for your team.', + authenticated: true, + )] + #[Authenticated] + #[UrlParam( + name : 'id', + type : 'int', + description: 'ID.', + example : '1234' + )] + #[QueryParam( + name : 'cached', + type : 'bool', + description: 'Request the response to be cached. Default: `true`.', + required : false, + example : 1 + )] + #[QueryParam( + name : 'fields', + type : 'string', + description: 'Comma-separated list of database fields to return within the object.', + required : false, + example : 'id,created_at' + )] public function show(int $id) { $this->query = AuditItem::where('auditable_team_id', Auth::user()->current_team_id)->with($this->associatedData); @@ -76,7 +136,7 @@ public function show(int $id) * PUT /{id} * * @param string $id - * + * @hideFromAPIDocumentation * @return JsonResponse */ public function update(string $id) @@ -89,7 +149,7 @@ public function update(string $id) /** * DELETE / {id} - * + * @hideFromAPIDocumentation * @param string $id * * @return JsonResponse diff --git a/app/Http/Controllers/Api/V1/ApiMyTeamController.php b/app/Http/Controllers/Api/V1/ApiMyTeamController.php index cc75de5..8ad0486 100644 --- a/app/Http/Controllers/Api/V1/ApiMyTeamController.php +++ b/app/Http/Controllers/Api/V1/ApiMyTeamController.php @@ -18,8 +18,10 @@ use Knuckles\Scribe\Attributes\Group; use Knuckles\Scribe\Attributes\QueryParam; use Knuckles\Scribe\Attributes\Response; +use Knuckles\Scribe\Attributes\Subgroup; -#[Group('/my-team', 'Retrieve your team details.')] +#[Group('App Endpoints')] +#[Subgroup('/my-team', 'Retrieve your team details.')] class ApiMyTeamController extends Controller { use HandlesAPIRequests; @@ -61,7 +63,7 @@ class ApiMyTeamController extends Controller example : 'id,created_at' )] #[Response( - content : '{"meta": {"responseCode": 200, "limit": 50, "offset": 0, "message": "", "cached": false, "availableRelations": []}, "data": {"current_page": 1, "data": {"id": 1, "name": "Team A", "created_at": "2024-08-16T06:54:28.000000Z", "updated_at": "2024-08-16T06:54:28.000000Z", "deleted_at": null}], "first_page_url": "https:\/\/vine.openfoodnetwork.org.au\/api\/v1\/my-teams?page=1", "from": 1, "last_page": 1, "last_page_url": "https:\/\/vine.openfoodnetwork.org.au\/api\/v1\/my-teams?page=1", "links": [{"url": null, "label": "« Previous", "active": false}, {"url": "https:\/\/vine.openfoodnetwork.org.au\/api\/v1\/my-teams?page=1", "label": "1", "active": true}, {"url": null, "label": "Next »", "active": false}], "next_page_url": null, "path": "https:\/\/vine.openfoodnetwork.org.au\/api\/v1\/my-teams", "per_page": 50, "prev_page_url": null, "to": 2, "total": 2}}', + content : '{"meta": {"responseCode": 200, "limit": 50, "offset": 0, "message": "", "cached": false, "availableRelations": []}, "data": {"current_page": 1, "data": {"id": 1, "name": "Team A", "created_at": "2024-08-16T06:54:28.000000Z", "updated_at": "2024-08-16T06:54:28.000000Z", "deleted_at": null}], "first_page_url": "https:\/\/vine.openfoodnetwork.org.au\/api\/v1\/my-team?page=1", "from": 1, "last_page": 1, "last_page_url": "https:\/\/vine.openfoodnetwork.org.au\/api\/v1\/my-team?page=1", "links": [{"url": null, "label": "« Previous", "active": false}, {"url": "https:\/\/vine.openfoodnetwork.org.au\/api\/v1\/my-team?page=1", "label": "1", "active": true}, {"url": null, "label": "Next »", "active": false}], "next_page_url": null, "path": "https:\/\/vine.openfoodnetwork.org.au\/api\/v1\/my-team", "per_page": 50, "prev_page_url": null, "to": 2, "total": 2}}', status : 200, description: '' )] diff --git a/app/Http/Controllers/Api/V1/ApiMyTeamVouchersController.php b/app/Http/Controllers/Api/V1/ApiMyTeamVouchersController.php index 088faf8..8ca3b56 100644 --- a/app/Http/Controllers/Api/V1/ApiMyTeamVouchersController.php +++ b/app/Http/Controllers/Api/V1/ApiMyTeamVouchersController.php @@ -14,9 +14,11 @@ use Knuckles\Scribe\Attributes\Group; use Knuckles\Scribe\Attributes\QueryParam; use Knuckles\Scribe\Attributes\Response; +use Knuckles\Scribe\Attributes\Subgroup; use Knuckles\Scribe\Attributes\UrlParam; -#[Group('/my-team-vouchers', 'Manage your team\'s vouchers. Returns vouchers generated by your team, and allocated to your team.')] +#[Group('App Endpoints')] +#[Subgroup('/my-team-vouchers', 'Manage your team\'s vouchers. Returns vouchers generated by your team, and allocated to your team.')] class ApiMyTeamVouchersController extends Controller { use HandlesAPIRequests; diff --git a/app/Http/Controllers/Api/V1/ApiMyTeamsController.php b/app/Http/Controllers/Api/V1/ApiMyTeamsController.php index d5ba85e..faa67b3 100644 --- a/app/Http/Controllers/Api/V1/ApiMyTeamsController.php +++ b/app/Http/Controllers/Api/V1/ApiMyTeamsController.php @@ -15,8 +15,10 @@ use Knuckles\Scribe\Attributes\Group; use Knuckles\Scribe\Attributes\QueryParam; use Knuckles\Scribe\Attributes\Response; +use Knuckles\Scribe\Attributes\Subgroup; -#[Group('/my-teams', 'Teams you are a member of.')] +#[Group('App Endpoints')] +#[Subgroup('/my-teams', 'Teams you are a member of.')] class ApiMyTeamsController extends Controller { use HandlesAPIRequests; diff --git a/app/Http/Controllers/Api/V1/ApiShopsController.php b/app/Http/Controllers/Api/V1/ApiShopsController.php index 4d12f11..94ee9e8 100644 --- a/app/Http/Controllers/Api/V1/ApiShopsController.php +++ b/app/Http/Controllers/Api/V1/ApiShopsController.php @@ -18,8 +18,10 @@ use Knuckles\Scribe\Attributes\Endpoint; use Knuckles\Scribe\Attributes\Group; use Knuckles\Scribe\Attributes\Response; +use Knuckles\Scribe\Attributes\Subgroup; -#[Group('/shops', 'API for managing shops')] +#[Group('App Endpoints')] +#[Subgroup('/shops', 'API for managing shops')] class ApiShopsController extends Controller { use HandlesAPIRequests; diff --git a/app/Http/Controllers/Api/V1/ApiSystemStatisticsController.php b/app/Http/Controllers/Api/V1/ApiSystemStatisticsController.php index 9616e96..494ed38 100644 --- a/app/Http/Controllers/Api/V1/ApiSystemStatisticsController.php +++ b/app/Http/Controllers/Api/V1/ApiSystemStatisticsController.php @@ -15,9 +15,11 @@ use Knuckles\Scribe\Attributes\Group; use Knuckles\Scribe\Attributes\QueryParam; use Knuckles\Scribe\Attributes\Response; +use Knuckles\Scribe\Attributes\Subgroup; use Knuckles\Scribe\Attributes\UrlParam; -#[Group('/system-statistics', 'Check out some Vine platform statistics.')] +#[Group('App Endpoints')] +#[Subgroup('/system-statistics', 'Vine platform statistics.')] class ApiSystemStatisticsController extends Controller { use HandlesAPIRequests; diff --git a/app/Http/Middleware/VerifyApiTokenSignature.php b/app/Http/Middleware/VerifyApiTokenSignature.php new file mode 100644 index 0000000..38ec220 --- /dev/null +++ b/app/Http/Middleware/VerifyApiTokenSignature.php @@ -0,0 +1,133 @@ +user() || !$request->user()->currentAccessToken()) { + $allow = false; + } + + if (!$request->hasHeader('X-AUTHORIZATION')) { + $allow = false; + $errorMessage = ApiResponse::RESPONSE_AUTHORIZATION_SIGNATURE_INCORRECT->value . ' ' . ApiResponse::RESPONSE_AUTHORIZATION_SIGNATURE_INCORRECT_JWT_HEADER_REQUIRED->value; + } else { + + + try { + + $jwt = $request->header('X-AUTHORIZATION'); + $jwtBits = explode(' ', $jwt); + $jwtContents = end($jwtBits); + $parser = new Parser(new JoseEncoder()); + $token = $parser->parse( + $jwtContents + ); + $accessTokenSecret = Crypt::decrypt($request->user()->currentAccessToken()->secret); + $validator = new Validator(); + $signingKey = InMemory::plainText($accessTokenSecret); + + if ($token->isExpired(now())) { + $allow = false; + $errorMessage = ApiResponse::RESPONSE_AUTHORIZATION_SIGNATURE_INCORRECT->value . ' ' . ApiResponse::RESPONSE_AUTHORIZATION_SIGNATURE_INCORRECT_EXPIRED->value; + } else if (!$token->claims()->has('iat')) { + $allow = false; + $errorMessage = ApiResponse::RESPONSE_AUTHORIZATION_SIGNATURE_INCORRECT->value . ' ' . ApiResponse::RESPONSE_AUTHORIZATION_SIGNATURE_INCORRECT_IAT_CLAIM_REQUIRED->value; + } else if (!$token->claims()->has('exp')) { + $allow = false; + $errorMessage = ApiResponse::RESPONSE_AUTHORIZATION_SIGNATURE_INCORRECT->value . ' ' . ApiResponse::RESPONSE_AUTHORIZATION_SIGNATURE_INCORRECT_EXP_CLAIM_REQUIRED->value; + } else { + + $iat = $token->claims()->get('iat'); + $iatCarbon = Carbon::parse($iat); + + $exp = $token->claims()->get('exp'); + $expCarbon = Carbon::parse($exp); + + if ($iatCarbon->isBefore(now()->subMinute())) { + $allow = false; + $errorMessage = ApiResponse::RESPONSE_AUTHORIZATION_SIGNATURE_INCORRECT->value . ' ' . ApiResponse::RESPONSE_AUTHORIZATION_SIGNATURE_INCORRECT_IAT_EXPIRED->value; + } else if ($expCarbon->isAfter($iatCarbon->addMinute())) { + $allow = false; + $errorMessage = ApiResponse::RESPONSE_AUTHORIZATION_SIGNATURE_INCORRECT->value . ' ' . ApiResponse::RESPONSE_AUTHORIZATION_SIGNATURE_INCORRECT_IAT_EXP_TOO_LARGE->value; + } else { + $isValid = $validator->validate($token, new SignedWith(new Sha256(), $signingKey)); + + if (!$isValid) { + $allow = false; + $errorMessage = ApiResponse::RESPONSE_AUTHORIZATION_SIGNATURE_INCORRECT; + } + + /** + * The JWT signature is valid, based on the access token's secret + */ + } + + } + + + } catch (CannotDecodeContent|InvalidTokenStructure|UnsupportedHeaderFound $e) { + $allow = false; + $errorMessage = ApiResponse::RESPONSE_AUTHORIZATION_SIGNATURE_INCORRECT; + } + + } + + } + + + if (!$allow) { + $reply = [ + 'meta' => [ + 'numRecords' => 0, + 'totalRows' => 0, + 'responseCode' => 401, + 'message' => $errorMessage, + ], + 'data' => [], + ]; + + return response()->json($reply, 401); + } + + return $next($request); + + } +} diff --git a/app/Models/PersonalAccessToken.php b/app/Models/PersonalAccessToken.php index 1f23411..067fd04 100644 --- a/app/Models/PersonalAccessToken.php +++ b/app/Models/PersonalAccessToken.php @@ -20,6 +20,7 @@ class PersonalAccessToken extends SanctumPersonalAccessToken protected $fillable = [ 'name', 'token', + 'secret', 'abilities', 'team_id', ]; diff --git a/app/Models/User.php b/app/Models/User.php index 88906b8..4392783 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -5,13 +5,19 @@ namespace App\Models; // use Illuminate\Contracts\Auth\MustVerifyEmail; +use DateTimeInterface; use App\Events\Users\UserWasCreated; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Relations\BelongsTo; use Illuminate\Database\Eloquent\Relations\HasMany; +use Illuminate\Database\Eloquent\Relations\MorphMany; use Illuminate\Foundation\Auth\User as Authenticatable; use Illuminate\Notifications\Notifiable; +use Illuminate\Support\Facades\Crypt; +use Illuminate\Support\Str; use Laravel\Sanctum\HasApiTokens; +use Laravel\Sanctum\NewAccessToken; +use Laravel\Sanctum\Sanctum; class User extends Authenticatable { @@ -66,4 +72,41 @@ public function currentTeam(): BelongsTo { return $this->belongsTo(Team::class); } + + + /** + * Get the access tokens that belong to model. + * + * @return MorphMany + */ + public function tokens(): MorphMany + { + return $this->morphMany(PersonalAccessToken::class, 'tokenable'); + } + + + /** + * Create a new personal access token for the user. + * + * @param string $name + * @param array $abilities + * @param DateTimeInterface|null $expiresAt + * @return NewAccessToken + */ + public function createToken(string $name, array $abilities = ['*'], DateTimeInterface $expiresAt = null): NewAccessToken + { + + $plainTextToken = $this->generateTokenString(); + + $token = $this->tokens()->create([ + 'name' => $name, + 'token' => hash('sha256', $plainTextToken), + 'secret' => Crypt::encrypt(Str::random(32)), + 'abilities' => $abilities, + 'expires_at' => $expiresAt, + ]); + + return new NewAccessToken($token, $token->getKey() . '|' . $plainTextToken); + } + } diff --git a/app/Services/PersonalAccessTokenService.php b/app/Services/PersonalAccessTokenService.php new file mode 100644 index 0000000..1cfdc8d --- /dev/null +++ b/app/Services/PersonalAccessTokenService.php @@ -0,0 +1,38 @@ +secret); + $signingKey = InMemory::plainText($patDecryptedSecret); + $now = new \DateTimeImmutable(); + $token = $tokenBuilder + ->issuedBy(config('app.url')) + ->issuedAt($now) + ->expiresAt($now->modify('+1 minute')) + ->getToken($algorithm, $signingKey); + + return $token->toString(); + } +} diff --git a/composer.json b/composer.json index c3a82c0..5e6a74c 100644 --- a/composer.json +++ b/composer.json @@ -10,6 +10,7 @@ "laravel/framework": "^11.9", "laravel/sanctum": "^4.0", "laravel/tinker": "^2.9", + "lcobucci/jwt": "^5.3", "league/flysystem-aws-s3-v3": "^3.28", "sentry/sentry-laravel": "^4.7", "spatie/laravel-flare": "^1.0", diff --git a/composer.lock b/composer.lock index 30b451e..9414d44 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "4cbcdaa6807cd3c0f82e5de8209e045b", + "content-hash": "e8da14a07f54e56d578425c608248d49", "packages": [ { "name": "aws/aws-crt-php", @@ -62,16 +62,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.320.9", + "version": "3.321.4", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "1284cecc00d4ac80815c542ef3882d3a7a25ac50" + "reference": "986326efde1d0598ec9fc1b185716550be8ef522" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/1284cecc00d4ac80815c542ef3882d3a7a25ac50", - "reference": "1284cecc00d4ac80815c542ef3882d3a7a25ac50", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/986326efde1d0598ec9fc1b185716550be8ef522", + "reference": "986326efde1d0598ec9fc1b185716550be8ef522", "shasum": "" }, "require": { @@ -154,9 +154,9 @@ "support": { "forum": "https://forums.aws.amazon.com/forum.jspa?forumID=80", "issues": "https://github.com/aws/aws-sdk-php/issues", - "source": "https://github.com/aws/aws-sdk-php/tree/3.320.9" + "source": "https://github.com/aws/aws-sdk-php/tree/3.321.4" }, - "time": "2024-08-27T18:06:27+00:00" + "time": "2024-09-04T18:09:31+00:00" }, { "name": "brick/math", @@ -1339,16 +1339,16 @@ }, { "name": "laravel/framework", - "version": "v11.21.0", + "version": "v11.22.0", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "9d9d36708d56665b12185493f684abce38ad2d30" + "reference": "868c75beacc47d0f361b919bbc155c0b619bf3d5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/9d9d36708d56665b12185493f684abce38ad2d30", - "reference": "9d9d36708d56665b12185493f684abce38ad2d30", + "url": "https://api.github.com/repos/laravel/framework/zipball/868c75beacc47d0f361b919bbc155c0b619bf3d5", + "reference": "868c75beacc47d0f361b919bbc155c0b619bf3d5", "shasum": "" }, "require": { @@ -1541,7 +1541,7 @@ "issues": "https://github.com/laravel/framework/issues", "source": "https://github.com/laravel/framework" }, - "time": "2024-08-20T15:00:52+00:00" + "time": "2024-09-03T15:27:15+00:00" }, { "name": "laravel/prompts", @@ -1792,6 +1792,79 @@ }, "time": "2024-01-04T16:10:04+00:00" }, + { + "name": "lcobucci/jwt", + "version": "5.3.0", + "source": { + "type": "git", + "url": "https://github.com/lcobucci/jwt.git", + "reference": "08071d8d2c7f4b00222cc4b1fb6aa46990a80f83" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/lcobucci/jwt/zipball/08071d8d2c7f4b00222cc4b1fb6aa46990a80f83", + "reference": "08071d8d2c7f4b00222cc4b1fb6aa46990a80f83", + "shasum": "" + }, + "require": { + "ext-openssl": "*", + "ext-sodium": "*", + "php": "~8.1.0 || ~8.2.0 || ~8.3.0", + "psr/clock": "^1.0" + }, + "require-dev": { + "infection/infection": "^0.27.0", + "lcobucci/clock": "^3.0", + "lcobucci/coding-standard": "^11.0", + "phpbench/phpbench": "^1.2.9", + "phpstan/extension-installer": "^1.2", + "phpstan/phpstan": "^1.10.7", + "phpstan/phpstan-deprecation-rules": "^1.1.3", + "phpstan/phpstan-phpunit": "^1.3.10", + "phpstan/phpstan-strict-rules": "^1.5.0", + "phpunit/phpunit": "^10.2.6" + }, + "suggest": { + "lcobucci/clock": ">= 3.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Lcobucci\\JWT\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Luís Cobucci", + "email": "lcobucci@gmail.com", + "role": "Developer" + } + ], + "description": "A simple library to work with JSON Web Token and JSON Web Signature", + "keywords": [ + "JWS", + "jwt" + ], + "support": { + "issues": "https://github.com/lcobucci/jwt/issues", + "source": "https://github.com/lcobucci/jwt/tree/5.3.0" + }, + "funding": [ + { + "url": "https://github.com/lcobucci", + "type": "github" + }, + { + "url": "https://www.patreon.com/lcobucci", + "type": "patreon" + } + ], + "time": "2024-04-11T23:07:54+00:00" + }, { "name": "league/commonmark", "version": "2.5.3", @@ -2326,16 +2399,16 @@ }, { "name": "mtdowling/jmespath.php", - "version": "2.7.0", + "version": "2.8.0", "source": { "type": "git", "url": "https://github.com/jmespath/jmespath.php.git", - "reference": "bbb69a935c2cbb0c03d7f481a238027430f6440b" + "reference": "a2a865e05d5f420b50cc2f85bb78d565db12a6bc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/jmespath/jmespath.php/zipball/bbb69a935c2cbb0c03d7f481a238027430f6440b", - "reference": "bbb69a935c2cbb0c03d7f481a238027430f6440b", + "url": "https://api.github.com/repos/jmespath/jmespath.php/zipball/a2a865e05d5f420b50cc2f85bb78d565db12a6bc", + "reference": "a2a865e05d5f420b50cc2f85bb78d565db12a6bc", "shasum": "" }, "require": { @@ -2352,7 +2425,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.7-dev" + "dev-master": "2.8-dev" } }, "autoload": { @@ -2386,9 +2459,9 @@ ], "support": { "issues": "https://github.com/jmespath/jmespath.php/issues", - "source": "https://github.com/jmespath/jmespath.php/tree/2.7.0" + "source": "https://github.com/jmespath/jmespath.php/tree/2.8.0" }, - "time": "2023-08-25T10:54:48+00:00" + "time": "2024-09-04T18:46:31+00:00" }, { "name": "nesbot/carbon", @@ -4350,16 +4423,16 @@ }, { "name": "symfony/console", - "version": "v7.1.3", + "version": "v7.1.4", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "cb1dcb30ebc7005c29864ee78adb47b5fb7c3cd9" + "reference": "1eed7af6961d763e7832e874d7f9b21c3ea9c111" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/cb1dcb30ebc7005c29864ee78adb47b5fb7c3cd9", - "reference": "cb1dcb30ebc7005c29864ee78adb47b5fb7c3cd9", + "url": "https://api.github.com/repos/symfony/console/zipball/1eed7af6961d763e7832e874d7f9b21c3ea9c111", + "reference": "1eed7af6961d763e7832e874d7f9b21c3ea9c111", "shasum": "" }, "require": { @@ -4423,7 +4496,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v7.1.3" + "source": "https://github.com/symfony/console/tree/v7.1.4" }, "funding": [ { @@ -4439,7 +4512,7 @@ "type": "tidelift" } ], - "time": "2024-07-26T12:41:01+00:00" + "time": "2024-08-15T22:48:53+00:00" }, { "name": "symfony/css-selector", @@ -4806,16 +4879,16 @@ }, { "name": "symfony/finder", - "version": "v7.1.3", + "version": "v7.1.4", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "717c6329886f32dc65e27461f80f2a465412fdca" + "reference": "d95bbf319f7d052082fb7af147e0f835a695e823" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/717c6329886f32dc65e27461f80f2a465412fdca", - "reference": "717c6329886f32dc65e27461f80f2a465412fdca", + "url": "https://api.github.com/repos/symfony/finder/zipball/d95bbf319f7d052082fb7af147e0f835a695e823", + "reference": "d95bbf319f7d052082fb7af147e0f835a695e823", "shasum": "" }, "require": { @@ -4850,7 +4923,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v7.1.3" + "source": "https://github.com/symfony/finder/tree/v7.1.4" }, "funding": [ { @@ -4866,20 +4939,20 @@ "type": "tidelift" } ], - "time": "2024-07-24T07:08:44+00:00" + "time": "2024-08-13T14:28:19+00:00" }, { "name": "symfony/http-client", - "version": "v7.1.3", + "version": "v7.1.4", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "b79858aa7a051ea791b0d50269a234a0b50cb231" + "reference": "a8f8d60b30b331cf4b743b3632e5acdba3f8285c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/b79858aa7a051ea791b0d50269a234a0b50cb231", - "reference": "b79858aa7a051ea791b0d50269a234a0b50cb231", + "url": "https://api.github.com/repos/symfony/http-client/zipball/a8f8d60b30b331cf4b743b3632e5acdba3f8285c", + "reference": "a8f8d60b30b331cf4b743b3632e5acdba3f8285c", "shasum": "" }, "require": { @@ -4944,7 +5017,7 @@ "http" ], "support": { - "source": "https://github.com/symfony/http-client/tree/v7.1.3" + "source": "https://github.com/symfony/http-client/tree/v7.1.4" }, "funding": [ { @@ -4960,7 +5033,7 @@ "type": "tidelift" } ], - "time": "2024-07-17T06:10:24+00:00" + "time": "2024-08-26T06:32:37+00:00" }, { "name": "symfony/http-client-contracts", @@ -5119,16 +5192,16 @@ }, { "name": "symfony/http-kernel", - "version": "v7.1.3", + "version": "v7.1.4", "source": { "type": "git", "url": "https://github.com/symfony/http-kernel.git", - "reference": "db9702f3a04cc471ec8c70e881825db26ac5f186" + "reference": "6efcbd1b3f444f631c386504fc83eeca25963747" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-kernel/zipball/db9702f3a04cc471ec8c70e881825db26ac5f186", - "reference": "db9702f3a04cc471ec8c70e881825db26ac5f186", + "url": "https://api.github.com/repos/symfony/http-kernel/zipball/6efcbd1b3f444f631c386504fc83eeca25963747", + "reference": "6efcbd1b3f444f631c386504fc83eeca25963747", "shasum": "" }, "require": { @@ -5213,7 +5286,7 @@ "description": "Provides a structured process for converting a Request into a Response", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-kernel/tree/v7.1.3" + "source": "https://github.com/symfony/http-kernel/tree/v7.1.4" }, "funding": [ { @@ -5229,7 +5302,7 @@ "type": "tidelift" } ], - "time": "2024-07-26T14:58:15+00:00" + "time": "2024-08-30T17:02:28+00:00" }, { "name": "symfony/mailer", @@ -5382,16 +5455,16 @@ }, { "name": "symfony/mime", - "version": "v7.1.2", + "version": "v7.1.4", "source": { "type": "git", "url": "https://github.com/symfony/mime.git", - "reference": "26a00b85477e69a4bab63b66c5dce64f18b0cbfc" + "reference": "ccaa6c2503db867f472a587291e764d6a1e58758" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/mime/zipball/26a00b85477e69a4bab63b66c5dce64f18b0cbfc", - "reference": "26a00b85477e69a4bab63b66c5dce64f18b0cbfc", + "url": "https://api.github.com/repos/symfony/mime/zipball/ccaa6c2503db867f472a587291e764d6a1e58758", + "reference": "ccaa6c2503db867f472a587291e764d6a1e58758", "shasum": "" }, "require": { @@ -5446,7 +5519,7 @@ "mime-type" ], "support": { - "source": "https://github.com/symfony/mime/tree/v7.1.2" + "source": "https://github.com/symfony/mime/tree/v7.1.4" }, "funding": [ { @@ -5462,7 +5535,7 @@ "type": "tidelift" } ], - "time": "2024-06-28T10:03:55+00:00" + "time": "2024-08-13T14:28:19+00:00" }, { "name": "symfony/options-resolver", @@ -6304,16 +6377,16 @@ }, { "name": "symfony/psr-http-message-bridge", - "version": "v7.1.3", + "version": "v7.1.4", "source": { "type": "git", "url": "https://github.com/symfony/psr-http-message-bridge.git", - "reference": "1365d10f5476f74a27cf9c2d1eee70c069019db0" + "reference": "405a7bcd872f1563966f64be19f1362d94ce71ab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/1365d10f5476f74a27cf9c2d1eee70c069019db0", - "reference": "1365d10f5476f74a27cf9c2d1eee70c069019db0", + "url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/405a7bcd872f1563966f64be19f1362d94ce71ab", + "reference": "405a7bcd872f1563966f64be19f1362d94ce71ab", "shasum": "" }, "require": { @@ -6367,7 +6440,7 @@ "psr-7" ], "support": { - "source": "https://github.com/symfony/psr-http-message-bridge/tree/v7.1.3" + "source": "https://github.com/symfony/psr-http-message-bridge/tree/v7.1.4" }, "funding": [ { @@ -6383,20 +6456,20 @@ "type": "tidelift" } ], - "time": "2024-07-17T06:10:24+00:00" + "time": "2024-08-15T22:48:53+00:00" }, { "name": "symfony/routing", - "version": "v7.1.3", + "version": "v7.1.4", "source": { "type": "git", "url": "https://github.com/symfony/routing.git", - "reference": "8a908a3f22d5a1b5d297578c2ceb41b02fa916d0" + "reference": "1500aee0094a3ce1c92626ed8cf3c2037e86f5a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/routing/zipball/8a908a3f22d5a1b5d297578c2ceb41b02fa916d0", - "reference": "8a908a3f22d5a1b5d297578c2ceb41b02fa916d0", + "url": "https://api.github.com/repos/symfony/routing/zipball/1500aee0094a3ce1c92626ed8cf3c2037e86f5a7", + "reference": "1500aee0094a3ce1c92626ed8cf3c2037e86f5a7", "shasum": "" }, "require": { @@ -6448,7 +6521,7 @@ "url" ], "support": { - "source": "https://github.com/symfony/routing/tree/v7.1.3" + "source": "https://github.com/symfony/routing/tree/v7.1.4" }, "funding": [ { @@ -6464,7 +6537,7 @@ "type": "tidelift" } ], - "time": "2024-07-17T06:10:24+00:00" + "time": "2024-08-29T08:16:25+00:00" }, { "name": "symfony/service-contracts", @@ -6551,16 +6624,16 @@ }, { "name": "symfony/string", - "version": "v7.1.3", + "version": "v7.1.4", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "ea272a882be7f20cad58d5d78c215001617b7f07" + "reference": "6cd670a6d968eaeb1c77c2e76091c45c56bc367b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/ea272a882be7f20cad58d5d78c215001617b7f07", - "reference": "ea272a882be7f20cad58d5d78c215001617b7f07", + "url": "https://api.github.com/repos/symfony/string/zipball/6cd670a6d968eaeb1c77c2e76091c45c56bc367b", + "reference": "6cd670a6d968eaeb1c77c2e76091c45c56bc367b", "shasum": "" }, "require": { @@ -6618,7 +6691,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v7.1.3" + "source": "https://github.com/symfony/string/tree/v7.1.4" }, "funding": [ { @@ -6634,7 +6707,7 @@ "type": "tidelift" } ], - "time": "2024-07-22T10:25:37+00:00" + "time": "2024-08-12T09:59:40+00:00" }, { "name": "symfony/translation", @@ -6810,16 +6883,16 @@ }, { "name": "symfony/uid", - "version": "v7.1.1", + "version": "v7.1.4", "source": { "type": "git", "url": "https://github.com/symfony/uid.git", - "reference": "bb59febeecc81528ff672fad5dab7f06db8c8277" + "reference": "82177535395109075cdb45a70533aa3d7a521cdf" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/uid/zipball/bb59febeecc81528ff672fad5dab7f06db8c8277", - "reference": "bb59febeecc81528ff672fad5dab7f06db8c8277", + "url": "https://api.github.com/repos/symfony/uid/zipball/82177535395109075cdb45a70533aa3d7a521cdf", + "reference": "82177535395109075cdb45a70533aa3d7a521cdf", "shasum": "" }, "require": { @@ -6864,7 +6937,7 @@ "uuid" ], "support": { - "source": "https://github.com/symfony/uid/tree/v7.1.1" + "source": "https://github.com/symfony/uid/tree/v7.1.4" }, "funding": [ { @@ -6880,20 +6953,20 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:57:53+00:00" + "time": "2024-08-12T09:59:40+00:00" }, { "name": "symfony/var-dumper", - "version": "v7.1.3", + "version": "v7.1.4", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "86af4617cca75a6e28598f49ae0690f3b9d4591f" + "reference": "a5fa7481b199090964d6fd5dab6294d5a870c7aa" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/86af4617cca75a6e28598f49ae0690f3b9d4591f", - "reference": "86af4617cca75a6e28598f49ae0690f3b9d4591f", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/a5fa7481b199090964d6fd5dab6294d5a870c7aa", + "reference": "a5fa7481b199090964d6fd5dab6294d5a870c7aa", "shasum": "" }, "require": { @@ -6947,7 +7020,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v7.1.3" + "source": "https://github.com/symfony/var-dumper/tree/v7.1.4" }, "funding": [ { @@ -6963,7 +7036,7 @@ "type": "tidelift" } ], - "time": "2024-07-26T12:41:01+00:00" + "time": "2024-08-30T16:12:47+00:00" }, { "name": "tightenco/ziggy", @@ -7543,16 +7616,16 @@ }, { "name": "knuckleswtf/scribe", - "version": "4.37.1", + "version": "4.37.2", "source": { "type": "git", "url": "https://github.com/knuckleswtf/scribe.git", - "reference": "5eb0f65973db9df5ba455f8bbcc8a1cd6573564b" + "reference": "6318f3f68cbf09328e5cb6843ce1739e529ef1ac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/knuckleswtf/scribe/zipball/5eb0f65973db9df5ba455f8bbcc8a1cd6573564b", - "reference": "5eb0f65973db9df5ba455f8bbcc8a1cd6573564b", + "url": "https://api.github.com/repos/knuckleswtf/scribe/zipball/6318f3f68cbf09328e5cb6843ce1739e529ef1ac", + "reference": "6318f3f68cbf09328e5cb6843ce1739e529ef1ac", "shasum": "" }, "require": { @@ -7626,7 +7699,7 @@ ], "support": { "issues": "https://github.com/knuckleswtf/scribe/issues", - "source": "https://github.com/knuckleswtf/scribe/tree/4.37.1" + "source": "https://github.com/knuckleswtf/scribe/tree/4.37.2" }, "funding": [ { @@ -7634,7 +7707,7 @@ "type": "patreon" } ], - "time": "2024-07-11T13:57:05+00:00" + "time": "2024-08-30T12:15:51+00:00" }, { "name": "laravel/breeze", @@ -7698,16 +7771,16 @@ }, { "name": "laravel/pint", - "version": "v1.17.2", + "version": "v1.17.3", "source": { "type": "git", "url": "https://github.com/laravel/pint.git", - "reference": "e8a88130a25e3f9d4d5785e6a1afca98268ab110" + "reference": "9d77be916e145864f10788bb94531d03e1f7b482" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/pint/zipball/e8a88130a25e3f9d4d5785e6a1afca98268ab110", - "reference": "e8a88130a25e3f9d4d5785e6a1afca98268ab110", + "url": "https://api.github.com/repos/laravel/pint/zipball/9d77be916e145864f10788bb94531d03e1f7b482", + "reference": "9d77be916e145864f10788bb94531d03e1f7b482", "shasum": "" }, "require": { @@ -7718,13 +7791,13 @@ "php": "^8.1.0" }, "require-dev": { - "friendsofphp/php-cs-fixer": "^3.61.1", - "illuminate/view": "^10.48.18", + "friendsofphp/php-cs-fixer": "^3.64.0", + "illuminate/view": "^10.48.20", "larastan/larastan": "^2.9.8", "laravel-zero/framework": "^10.4.0", "mockery/mockery": "^1.6.12", "nunomaduro/termwind": "^1.15.1", - "pestphp/pest": "^2.35.0" + "pestphp/pest": "^2.35.1" }, "bin": [ "builds/pint" @@ -7760,20 +7833,20 @@ "issues": "https://github.com/laravel/pint/issues", "source": "https://github.com/laravel/pint" }, - "time": "2024-08-06T15:11:54+00:00" + "time": "2024-09-03T15:00:28+00:00" }, { "name": "laravel/sail", - "version": "v1.31.1", + "version": "v1.31.3", "source": { "type": "git", "url": "https://github.com/laravel/sail.git", - "reference": "3d06dd18cee8059baa7b388af00ba47f6d96bd85" + "reference": "0a7e2891a85eba2d448a9ffc6fc5ce367e924bc1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/sail/zipball/3d06dd18cee8059baa7b388af00ba47f6d96bd85", - "reference": "3d06dd18cee8059baa7b388af00ba47f6d96bd85", + "url": "https://api.github.com/repos/laravel/sail/zipball/0a7e2891a85eba2d448a9ffc6fc5ce367e924bc1", + "reference": "0a7e2891a85eba2d448a9ffc6fc5ce367e924bc1", "shasum": "" }, "require": { @@ -7823,7 +7896,7 @@ "issues": "https://github.com/laravel/sail/issues", "source": "https://github.com/laravel/sail" }, - "time": "2024-08-02T07:45:47+00:00" + "time": "2024-09-03T20:05:33+00:00" }, { "name": "mockery/mockery", @@ -8561,16 +8634,16 @@ }, { "name": "phpunit/phpunit", - "version": "11.3.1", + "version": "11.3.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "fe179875ef0c14e90b75617002767eae0a742641" + "reference": "8ed08766d9a2ed979a2f5fdbb95a0671523419c1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/fe179875ef0c14e90b75617002767eae0a742641", - "reference": "fe179875ef0c14e90b75617002767eae0a742641", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/8ed08766d9a2ed979a2f5fdbb95a0671523419c1", + "reference": "8ed08766d9a2ed979a2f5fdbb95a0671523419c1", "shasum": "" }, "require": { @@ -8584,8 +8657,8 @@ "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", "php": ">=8.2", - "phpunit/php-code-coverage": "^11.0.5", - "phpunit/php-file-iterator": "^5.0.1", + "phpunit/php-code-coverage": "^11.0.6", + "phpunit/php-file-iterator": "^5.1.0", "phpunit/php-invoker": "^5.0.1", "phpunit/php-text-template": "^4.0.1", "phpunit/php-timer": "^7.0.1", @@ -8641,7 +8714,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/11.3.1" + "source": "https://github.com/sebastianbergmann/phpunit/tree/11.3.3" }, "funding": [ { @@ -8657,7 +8730,7 @@ "type": "tidelift" } ], - "time": "2024-08-13T06:14:23+00:00" + "time": "2024-09-04T13:34:52+00:00" }, { "name": "sebastian/cli-parser", @@ -9829,16 +9902,16 @@ }, { "name": "symfony/yaml", - "version": "v7.1.1", + "version": "v7.1.4", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "fa34c77015aa6720469db7003567b9f772492bf2" + "reference": "92e080b851c1c655c786a2da77f188f2dccd0f4b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/fa34c77015aa6720469db7003567b9f772492bf2", - "reference": "fa34c77015aa6720469db7003567b9f772492bf2", + "url": "https://api.github.com/repos/symfony/yaml/zipball/92e080b851c1c655c786a2da77f188f2dccd0f4b", + "reference": "92e080b851c1c655c786a2da77f188f2dccd0f4b", "shasum": "" }, "require": { @@ -9880,7 +9953,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v7.1.1" + "source": "https://github.com/symfony/yaml/tree/v7.1.4" }, "funding": [ { @@ -9896,7 +9969,7 @@ "type": "tidelift" } ], - "time": "2024-05-31T14:57:53+00:00" + "time": "2024-08-12T09:59:40+00:00" }, { "name": "theseer/tokenizer", diff --git a/config/scribe.php b/config/scribe.php index 9303850..3de103a 100644 --- a/config/scribe.php +++ b/config/scribe.php @@ -5,36 +5,30 @@ return [ // The HTML for the generated documentation. If this is empty, Scribe will infer it from config('app.name'). - 'title' => env('APP_NAME') . ' - API Documentation', - + 'title' => env('APP_NAME') . ' - API Documentation', // A short description of your API. Will be included in the docs webpage, Postman collection and OpenAPI spec. 'description' => 'The API documentation for ' . env('APP_NAME') . '.', // The base URL displayed in the docs. If this is empty, Scribe will use the value of config('app.url') at generation time. // If you're using `laravel` type, you can set this to a dynamic string, like '{{ config("app.tenant_url") }}' to get a dynamic base URL. - 'base_url' => env('APP_PRODUCTION_URL'), + 'base_url' => env('APP_PRODUCTION_URL'), 'routes' => [ [ // Routes that match these conditions will be included in the docs - 'match' => [ + 'match' => [ // Match only routes whose paths match this pattern (use * as a wildcard to match any characters). Example: 'users/*'. 'prefixes' => ['api/v1/*'], // Match only routes whose domains match this pattern (use * as a wildcard to match any characters). Example: 'api.*'. - 'domains' => ['*'], - ], - - // Include these routes even if they did not match the rules above. - 'include' => [ - // 'users.index', 'POST /new', '/auth/*' + 'domains' => ['*'], ], - // Exclude these routes even if they matched the rules above. - 'exclude' => [ - // 'GET /health', - '/api/v1/admin/*', - ], + // 'exclude' => [ + // // 'GET /health', + // '/api/v1/admin/*', + // ], + ], ], @@ -43,10 +37,10 @@ // - "laravel" will generate the documentation as a Blade view, so you can add routing and authentication. // - "external_static" and "external_laravel" do the same as above, but generate a basic template, // passing the OpenAPI spec as a URL, allowing you to easily use the docs with an external generator - 'type' => 'laravel', + 'type' => 'laravel', // See https://scribe.knuckles.wtf/laravel/reference/config#theme for supported options - 'theme' => 'elements', + 'theme' => 'elements', 'static' => [ // HTML documentation, assets and Postman collection will be generated to this folder. @@ -57,11 +51,11 @@ 'laravel' => [ // Whether to automatically create a docs endpoint for you to view your generated docs. // If this is false, you can still set up routing manually. - 'add_routes' => true, + 'add_routes' => true, // URL path to use for the docs endpoint (if `add_routes` is true). // By default, `/docs` opens the HTML page, `/docs.postman` opens the Postman collection, and `/docs.openapi` the OpenAPI spec. - 'docs_url' => '/api-documentation', + 'docs_url' => '/api-documentation', // Directory within `public` in which to store CSS and JS assets. // By default, assets are stored in `public/vendor/scribe`. @@ -69,17 +63,17 @@ 'assets_directory' => null, // Middleware to attach to the docs endpoint (if `add_routes` is true). - 'middleware' => [], + 'middleware' => [], ], 'external' => [ 'html_attributes' => [], ], - 'try_it_out' => [ + 'try_it_out' => [ // Add a Try It Out button to your endpoints so consumers can test endpoints right from their browser. // Don't forget to enable CORS headers for your endpoints. - 'enabled' => false, + 'enabled' => false, // The base URL for the API tester to use (for example, you can set this to your staging URL). // Leave as null to use the current app URL when generating (config("app.url")). @@ -93,35 +87,98 @@ ], // How is your API authenticated? This information will be used in the displayed docs, generated examples and response calls. - 'auth' => [ + 'auth' => [ // Set this to true if ANY endpoints in your API use authentication. - 'enabled' => true, + 'enabled' => true, // Set this to true if your API should be authenticated by default. If so, you must also set `enabled` (above) to true. // You can then use @unauthenticated or @authenticated on individual endpoints to change their status from the default. - 'default' => true, + 'default' => true, // Where is the auth value meant to be sent in a request? // Options: query, body, basic, bearer, header (for custom header) - 'in' => 'bearer', + 'in' => 'bearer', // The name of the auth parameter (eg token, key, apiKey) or header (eg Authorization, Api-Key). - 'name' => 'key', + 'name' => 'key', // The value of the parameter to be used by Scribe to authenticate response calls. // This will NOT be included in the generated documentation. If empty, Scribe will use a random value. - 'use_value' => env('SCRIBE_AUTH_KEY'), + 'use_value' => env('SCRIBE_AUTH_KEY'), // Placeholder your users will see for the auth parameter in the example requests. // Set this to null if you want Scribe to use a random value as placeholder instead. 'placeholder' => '{YOUR_API_TOKEN}', // Any extra authentication-related info for your users. Markdown and HTML are supported. - 'extra_info' => 'You or your developer will receive an API token from our admins; ensure to keep this somewhere safe.', + 'extra_info' => ' +## About API Credentials +When you receive API credentials, they will be made up of a `token` and an accompanying `secret`. Your secret should never be displayed in front end code, or in any version control repositories, for security. + +## Signing Your requests +All API requests must be signed, to improve API security. To do this, you must generate a [JWT](https://jwt.io/introduction) comprising your current request, signed with your API Token secret. + +Send the JWT content in the `X-Authorization` header as follows + + +All JWTs must have the following claims: +- iat - _current timestamp, in UTC_ - must not be less than a minute ago +- exp - _expiry timestamp, in UTC_ - must not be more than a minute later than iat claim +- iss - _indicating issuer of the jwt_ + +### Generating a JWT + +#### PHP +```php + +use Lcobucci\JWT\Encoding\ChainedFormatter; +use Lcobucci\JWT\Encoding\JoseEncoder; +use Lcobucci\JWT\Signer\Hmac\Sha256; +use Lcobucci\JWT\Signer\Key\InMemory; +use Lcobucci\JWT\Token\Builder; + +$tokenBuilder = (new Builder(new JoseEncoder(), ChainedFormatter::default())); +$algorithm = new Sha256(); +$signingKey = InMemory::plainText(YOUR_API_SECRET); +$now = new \DateTimeImmutable(); +$token = $tokenBuilder + ->issuedBy(ISSUING_BODY) + ->issuedAt(now()) + ->expiresAt(now()->addMinute(1)) + ->getToken($algorithm, $signingKey); + +$jwt = $token->toString(); +``` + +#### Ruby +```ruby +require \'jwt\' + +# Your secret signing key (must be a strong secret) +signing_key = YOUR_API_SECRET + +# Define the payload (the data you want to encode in the token) +payload = { + iss: YOUR_ISSUING_BODY, # Your issuer + iat: Time.now.to_i # Token issued at time (now) + exp: Time.now.to_i + 60 # Token expiration time (1 minute from now) +} + +# Choose the algorithm for signing (HS256 is common for symmetric signing keys) +algorithm = \'HS256\' + +# Generate the JWT +token = JWT.encode(payload, signing_key, algorithm) + +puts "Generated JWT: #{token}" +``` +', ], // Text to place in the "Introduction" section, right after the `description`. Markdown and HTML are supported. - 'intro_text' => <<<'INTRO' + 'intro_text' => <<<'INTRO' + + This documentation aims to provide all the information you need to work with our API. <aside>As you scroll, you'll see code examples for working with the API in different programming languages in the dark area to the right (or as part of the content on mobile). @@ -143,7 +200,7 @@ // For 'static' docs, the collection will be generated to public/docs/collection.json. // For 'laravel' docs, it will be generated to storage/app/scribe/collection.json. // Setting `laravel.add_routes` to true (above) will also add a route for the collection. - 'postman' => [ + 'postman' => [ 'enabled' => true, 'overrides' => [ @@ -155,7 +212,7 @@ // For 'static' docs, the collection will be generated to public/docs/openapi.yaml. // For 'laravel' docs, it will be generated to storage/app/scribe/openapi.yaml. // Setting `laravel.add_routes` to true (above) will also add a route for the spec. - 'openapi' => [ + 'openapi' => [ 'enabled' => true, 'overrides' => [ @@ -163,14 +220,24 @@ ], ], - 'groups' => [ + 'groups' => [ // Endpoints which don't have a @group will be placed in this default group. 'default' => 'Endpoints', // By default, Scribe will sort groups alphabetically, and endpoints in the order their routes are defined. // You can override this by listing the groups, subgroups and endpoints here in the order you want them. // See https://scribe.knuckles.wtf/blog/laravel-v4#easier-sorting and https://scribe.knuckles.wtf/laravel/reference/config#order for details - 'order' => [], + 'order' => [ + 'App Endpoints' => [ + '/my-team', + '/my-teams', + '/my-team-audit-items', + '/my-team-vouchers', + '/system-statistics', + '/shops', + + ], + ], ], // Custom logo path. This will be used as the value of the src attribute for the <img> tag, @@ -178,7 +245,7 @@ // For example, if your logo is in public/img: // - 'logo' => '../img/logo.png' // for `static` type (output folder is public/docs) // - 'logo' => 'img/logo.png' // for `laravel` type - 'logo' => false, + 'logo' => false, // Customize the "Last updated" value displayed in the docs by specifying tokens and formats. // Examples: @@ -189,9 +256,9 @@ // The format you pass to `git` can be either "short" or "long". 'last_updated' => 'Last updated: {date:F j, Y}', - 'examples' => [ + 'examples' => [ // Set this to any number (eg. 1234) to generate the same example values for parameters on each run, - 'faker_seed' => null, + 'faker_seed' => null, // With API resources and transformers, Scribe tries to generate example models to use in your API responses. // By default, Scribe will try the model's factory, and if that fails, try fetching the first from the database. @@ -201,12 +268,12 @@ // The strategies Scribe will use to extract information about your routes at each stage. // If you create or install a custom strategy, add it here. - 'strategies' => [ - 'metadata' => [ + 'strategies' => [ + 'metadata' => [ Strategies\Metadata\GetFromDocBlocks::class, Strategies\Metadata\GetFromMetadataAttributes::class, ], - 'urlParameters' => [ + 'urlParameters' => [ Strategies\UrlParameters\GetFromLaravelAPI::class, Strategies\UrlParameters\GetFromUrlParamAttribute::class, Strategies\UrlParameters\GetFromUrlParamTag::class, @@ -217,24 +284,25 @@ Strategies\QueryParameters\GetFromQueryParamAttribute::class, Strategies\QueryParameters\GetFromQueryParamTag::class, ], - 'headers' => [ + 'headers' => [ Strategies\Headers\GetFromHeaderAttribute::class, Strategies\Headers\GetFromHeaderTag::class, [ 'override', [ - 'Content-Type' => 'application/json', - 'Accept' => 'application/json', + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', ], ], ], - 'bodyParameters' => [ + 'bodyParameters' => [ Strategies\BodyParameters\GetFromFormRequest::class, Strategies\BodyParameters\GetFromInlineValidator::class, Strategies\BodyParameters\GetFromBodyParamAttribute::class, Strategies\BodyParameters\GetFromBodyParamTag::class, ], - 'responses' => [ + 'responses' => [ Strategies\Responses\UseResponseAttributes::class, Strategies\Responses\UseTransformerTags::class, Strategies\Responses\UseApiResourceTags::class, @@ -243,7 +311,7 @@ [ Strategies\Responses\ResponseCalls::class, [ - 'only' => ['GET *'], + 'only' => ['GET *'], // Disable debug mode when generating response calls to avoid error stack traces in responses 'config' => [ 'app.debug' => false, @@ -251,7 +319,7 @@ ], ], ], - 'responseFields' => [ + 'responseFields' => [ Strategies\ResponseFields\GetFromResponseFieldAttribute::class, Strategies\ResponseFields\GetFromResponseFieldTag::class, ], diff --git a/database/migrations/2024_08_11_234216_create_personal_access_tokens_table.php b/database/migrations/2024_08_11_234216_create_personal_access_tokens_table.php index 0fc7a63..005a366 100644 --- a/database/migrations/2024_08_11_234216_create_personal_access_tokens_table.php +++ b/database/migrations/2024_08_11_234216_create_personal_access_tokens_table.php @@ -16,6 +16,7 @@ public function up(): void $table->morphs('tokenable'); $table->string('name'); $table->string('token', 64)->unique(); + $table->text('secret'); // Encrypted secret $table->text('abilities')->nullable(); $table->timestamp('last_used_at')->nullable(); $table->timestamp('expires_at')->nullable(); diff --git a/package-lock.json b/package-lock.json index 23cacd9..d5d65ef 100644 --- a/package-lock.json +++ b/package-lock.json @@ -50,12 +50,12 @@ } }, "node_modules/@babel/parser": { - "version": "7.25.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.4.tgz", - "integrity": "sha512-nq+eWrOgdtu3jG5Os4TQP3x3cLA8hR8TvJNjD8vnPa20WGycimcparWnLK4jJhElTK6SDyuJo1weMKO/5LpmLA==", + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.25.6.tgz", + "integrity": "sha512-trGdfBdbD0l1ZPmcJ83eNxB9rbEax4ALFTF7fN386TMYbeCQbyme5cOEXQhbGXKebwGaB/J52w1mrklMcbgy6Q==", "dev": true, "dependencies": { - "@babel/types": "^7.25.4" + "@babel/types": "^7.25.6" }, "bin": { "parser": "bin/babel-parser.js" @@ -65,9 +65,9 @@ } }, "node_modules/@babel/types": { - "version": "7.25.4", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.4.tgz", - "integrity": "sha512-zQ1ijeeCXVEh+aNL0RlmkPkG8HUiDcU2pzQQFjtbntgAczRASFzj4H+6+bV+dy1ntKR14I/DypeuRG1uma98iQ==", + "version": "7.25.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.25.6.tgz", + "integrity": "sha512-/l42B1qxpG6RdfYf343Uw1vmDjeNhneUXtzhojE7pDgfpEypmRhI6j1kr17XCVv4Cgl9HdAiQY2x0GwKm7rWCw==", "dev": true, "dependencies": { "@babel/helper-string-parser": "^7.24.8", @@ -583,9 +583,9 @@ } }, "node_modules/@rollup/rollup-android-arm-eabi": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.21.1.tgz", - "integrity": "sha512-2thheikVEuU7ZxFXubPDOtspKn1x0yqaYQwvALVtEcvFhMifPADBrgRPyHV0TF3b+9BgvgjgagVyvA/UqPZHmg==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.21.2.tgz", + "integrity": "sha512-fSuPrt0ZO8uXeS+xP3b+yYTCBUd05MoSp2N/MFOgjhhUhMmchXlpTQrTpI8T+YAwAQuK7MafsCOxW7VrPMrJcg==", "cpu": [ "arm" ], @@ -596,9 +596,9 @@ ] }, "node_modules/@rollup/rollup-android-arm64": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.21.1.tgz", - "integrity": "sha512-t1lLYn4V9WgnIFHXy1d2Di/7gyzBWS8G5pQSXdZqfrdCGTwi1VasRMSS81DTYb+avDs/Zz4A6dzERki5oRYz1g==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.21.2.tgz", + "integrity": "sha512-xGU5ZQmPlsjQS6tzTTGwMsnKUtu0WVbl0hYpTPauvbRAnmIvpInhJtgjj3mcuJpEiuUw4v1s4BimkdfDWlh7gA==", "cpu": [ "arm64" ], @@ -609,9 +609,9 @@ ] }, "node_modules/@rollup/rollup-darwin-arm64": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.21.1.tgz", - "integrity": "sha512-AH/wNWSEEHvs6t4iJ3RANxW5ZCK3fUnmf0gyMxWCesY1AlUj8jY7GC+rQE4wd3gwmZ9XDOpL0kcFnCjtN7FXlA==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.21.2.tgz", + "integrity": "sha512-99AhQ3/ZMxU7jw34Sq8brzXqWH/bMnf7ZVhvLk9QU2cOepbQSVTns6qoErJmSiAvU3InRqC2RRZ5ovh1KN0d0Q==", "cpu": [ "arm64" ], @@ -622,9 +622,9 @@ ] }, "node_modules/@rollup/rollup-darwin-x64": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.21.1.tgz", - "integrity": "sha512-dO0BIz/+5ZdkLZrVgQrDdW7m2RkrLwYTh2YMFG9IpBtlC1x1NPNSXkfczhZieOlOLEqgXOFH3wYHB7PmBtf+Bg==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.21.2.tgz", + "integrity": "sha512-ZbRaUvw2iN/y37x6dY50D8m2BnDbBjlnMPotDi/qITMJ4sIxNY33HArjikDyakhSv0+ybdUxhWxE6kTI4oX26w==", "cpu": [ "x64" ], @@ -635,9 +635,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-gnueabihf": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.21.1.tgz", - "integrity": "sha512-sWWgdQ1fq+XKrlda8PsMCfut8caFwZBmhYeoehJ05FdI0YZXk6ZyUjWLrIgbR/VgiGycrFKMMgp7eJ69HOF2pQ==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.21.2.tgz", + "integrity": "sha512-ztRJJMiE8nnU1YFcdbd9BcH6bGWG1z+jP+IPW2oDUAPxPjo9dverIOyXz76m6IPA6udEL12reYeLojzW2cYL7w==", "cpu": [ "arm" ], @@ -648,9 +648,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm-musleabihf": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.21.1.tgz", - "integrity": "sha512-9OIiSuj5EsYQlmwhmFRA0LRO0dRRjdCVZA3hnmZe1rEwRk11Jy3ECGGq3a7RrVEZ0/pCsYWx8jG3IvcrJ6RCew==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.21.2.tgz", + "integrity": "sha512-flOcGHDZajGKYpLV0JNc0VFH361M7rnV1ee+NTeC/BQQ1/0pllYcFmxpagltANYt8FYf9+kL6RSk80Ziwyhr7w==", "cpu": [ "arm" ], @@ -661,9 +661,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-gnu": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.21.1.tgz", - "integrity": "sha512-0kuAkRK4MeIUbzQYu63NrJmfoUVicajoRAL1bpwdYIYRcs57iyIV9NLcuyDyDXE2GiZCL4uhKSYAnyWpjZkWow==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.21.2.tgz", + "integrity": "sha512-69CF19Kp3TdMopyteO/LJbWufOzqqXzkrv4L2sP8kfMaAQ6iwky7NoXTp7bD6/irKgknDKM0P9E/1l5XxVQAhw==", "cpu": [ "arm64" ], @@ -674,9 +674,9 @@ ] }, "node_modules/@rollup/rollup-linux-arm64-musl": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.21.1.tgz", - "integrity": "sha512-/6dYC9fZtfEY0vozpc5bx1RP4VrtEOhNQGb0HwvYNwXD1BBbwQ5cKIbUVVU7G2d5WRE90NfB922elN8ASXAJEA==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.21.2.tgz", + "integrity": "sha512-48pD/fJkTiHAZTnZwR0VzHrao70/4MlzJrq0ZsILjLW/Ab/1XlVUStYyGt7tdyIiVSlGZbnliqmult/QGA2O2w==", "cpu": [ "arm64" ], @@ -687,9 +687,9 @@ ] }, "node_modules/@rollup/rollup-linux-powerpc64le-gnu": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.21.1.tgz", - "integrity": "sha512-ltUWy+sHeAh3YZ91NUsV4Xg3uBXAlscQe8ZOXRCVAKLsivGuJsrkawYPUEyCV3DYa9urgJugMLn8Z3Z/6CeyRQ==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.21.2.tgz", + "integrity": "sha512-cZdyuInj0ofc7mAQpKcPR2a2iu4YM4FQfuUzCVA2u4HI95lCwzjoPtdWjdpDKyHxI0UO82bLDoOaLfpZ/wviyQ==", "cpu": [ "ppc64" ], @@ -700,9 +700,9 @@ ] }, "node_modules/@rollup/rollup-linux-riscv64-gnu": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.21.1.tgz", - "integrity": "sha512-BggMndzI7Tlv4/abrgLwa/dxNEMn2gC61DCLrTzw8LkpSKel4o+O+gtjbnkevZ18SKkeN3ihRGPuBxjaetWzWg==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.21.2.tgz", + "integrity": "sha512-RL56JMT6NwQ0lXIQmMIWr1SW28z4E4pOhRRNqwWZeXpRlykRIlEpSWdsgNWJbYBEWD84eocjSGDu/XxbYeCmwg==", "cpu": [ "riscv64" ], @@ -713,9 +713,9 @@ ] }, "node_modules/@rollup/rollup-linux-s390x-gnu": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.21.1.tgz", - "integrity": "sha512-z/9rtlGd/OMv+gb1mNSjElasMf9yXusAxnRDrBaYB+eS1shFm6/4/xDH1SAISO5729fFKUkJ88TkGPRUh8WSAA==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.21.2.tgz", + "integrity": "sha512-PMxkrWS9z38bCr3rWvDFVGD6sFeZJw4iQlhrup7ReGmfn7Oukrr/zweLhYX6v2/8J6Cep9IEA/SmjXjCmSbrMQ==", "cpu": [ "s390x" ], @@ -726,9 +726,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-gnu": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.21.1.tgz", - "integrity": "sha512-kXQVcWqDcDKw0S2E0TmhlTLlUgAmMVqPrJZR+KpH/1ZaZhLSl23GZpQVmawBQGVhyP5WXIsIQ/zqbDBBYmxm5w==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.21.2.tgz", + "integrity": "sha512-B90tYAUoLhU22olrafY3JQCFLnT3NglazdwkHyxNDYF/zAxJt5fJUB/yBoWFoIQ7SQj+KLe3iL4BhOMa9fzgpw==", "cpu": [ "x64" ], @@ -739,9 +739,9 @@ ] }, "node_modules/@rollup/rollup-linux-x64-musl": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.21.1.tgz", - "integrity": "sha512-CbFv/WMQsSdl+bpX6rVbzR4kAjSSBuDgCqb1l4J68UYsQNalz5wOqLGYj4ZI0thGpyX5kc+LLZ9CL+kpqDovZA==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.21.2.tgz", + "integrity": "sha512-7twFizNXudESmC9oneLGIUmoHiiLppz/Xs5uJQ4ShvE6234K0VB1/aJYU3f/4g7PhssLGKBVCC37uRkkOi8wjg==", "cpu": [ "x64" ], @@ -752,9 +752,9 @@ ] }, "node_modules/@rollup/rollup-win32-arm64-msvc": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.21.1.tgz", - "integrity": "sha512-3Q3brDgA86gHXWHklrwdREKIrIbxC0ZgU8lwpj0eEKGBQH+31uPqr0P2v11pn0tSIxHvcdOWxa4j+YvLNx1i6g==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.21.2.tgz", + "integrity": "sha512-9rRero0E7qTeYf6+rFh3AErTNU1VCQg2mn7CQcI44vNUWM9Ze7MSRS/9RFuSsox+vstRt97+x3sOhEey024FRQ==", "cpu": [ "arm64" ], @@ -765,9 +765,9 @@ ] }, "node_modules/@rollup/rollup-win32-ia32-msvc": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.21.1.tgz", - "integrity": "sha512-tNg+jJcKR3Uwe4L0/wY3Ro0H+u3nrb04+tcq1GSYzBEmKLeOQF2emk1whxlzNqb6MMrQ2JOcQEpuuiPLyRcSIw==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.21.2.tgz", + "integrity": "sha512-5rA4vjlqgrpbFVVHX3qkrCo/fZTj1q0Xxpg+Z7yIo3J2AilW7t2+n6Q8Jrx+4MrYpAnjttTYF8rr7bP46BPzRw==", "cpu": [ "ia32" ], @@ -778,9 +778,9 @@ ] }, "node_modules/@rollup/rollup-win32-x64-msvc": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.21.1.tgz", - "integrity": "sha512-xGiIH95H1zU7naUyTKEyOA/I0aexNMUdO9qRv0bLKN3qu25bBdrxZHqA3PTJ24YNN/GdMzG4xkDcd/GvjuhfLg==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.21.2.tgz", + "integrity": "sha512-6UUxd0+SKomjdzuAcp+HAmxw1FlGBnl1v2yEPSabtx4lBfdXHDVsW7+lQkgz9cNFJGY3AWR7+V8P5BqkD9L9nA==", "cpu": [ "x64" ], @@ -791,15 +791,15 @@ ] }, "node_modules/@tailwindcss/forms": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/@tailwindcss/forms/-/forms-0.5.7.tgz", - "integrity": "sha512-QE7X69iQI+ZXwldE+rzasvbJiyV/ju1FGHH0Qn2W3FKbuYtqp8LKcy6iSw79fVUT5/Vvf+0XgLCeYVG+UV6hOw==", + "version": "0.5.8", + "resolved": "https://registry.npmjs.org/@tailwindcss/forms/-/forms-0.5.8.tgz", + "integrity": "sha512-DJs7B7NPD0JH7BVvdHWNviWmunlFhuEkz7FyFxE4japOWYMLl9b1D6+Z9mivJJPWr6AEbmlPqgiFRyLwFB1SgQ==", "dev": true, "dependencies": { "mini-svg-data-uri": "^1.2.3" }, "peerDependencies": { - "tailwindcss": ">=3.0.0 || >= 3.0.0-alpha.1" + "tailwindcss": ">=3.0.0 || >= 3.0.0-alpha.1 || >= 4.0.0-alpha.20" } }, "node_modules/@types/estree": { @@ -809,9 +809,9 @@ "dev": true }, "node_modules/@vitejs/plugin-vue": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-5.1.2.tgz", - "integrity": "sha512-nY9IwH12qeiJqumTCLJLE7IiNx7HZ39cbHaysEUd+Myvbz9KAqd2yq+U01Kab1R/H1BmiyM2ShTYlNH32Fzo3A==", + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-5.1.3.tgz", + "integrity": "sha512-3xbWsKEKXYlmX82aOHufFQVnkbMC/v8fLpWwh6hWOUrK5fbbtBh9Q/WWse27BFgSy2/e2c0fz5Scgya9h2GLhw==", "dev": true, "engines": { "node": "^18.0.0 || >=20.0.0" @@ -822,103 +822,103 @@ } }, "node_modules/@vue/compiler-core": { - "version": "3.4.38", - "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.4.38.tgz", - "integrity": "sha512-8IQOTCWnLFqfHzOGm9+P8OPSEDukgg3Huc92qSG49if/xI2SAwLHQO2qaPQbjCWPBcQoO1WYfXfTACUrWV3c5A==", + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.5.1.tgz", + "integrity": "sha512-WdjF+NSgFYdWttHevHw5uaJFtKPalhmxhlu2uREj8cLP0uyKKIR60/JvSZNTp0x+NSd63iTiORQTx3+tt55NWQ==", "dev": true, "dependencies": { - "@babel/parser": "^7.24.7", - "@vue/shared": "3.4.38", + "@babel/parser": "^7.25.3", + "@vue/shared": "3.5.1", "entities": "^4.5.0", "estree-walker": "^2.0.2", "source-map-js": "^1.2.0" } }, "node_modules/@vue/compiler-dom": { - "version": "3.4.38", - "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.4.38.tgz", - "integrity": "sha512-Osc/c7ABsHXTsETLgykcOwIxFktHfGSUDkb05V61rocEfsFDcjDLH/IHJSNJP+/Sv9KeN2Lx1V6McZzlSb9EhQ==", + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.5.1.tgz", + "integrity": "sha512-Ao23fB1lINo18HLCbJVApvzd9OQe8MgmQSgyY5+umbWj2w92w9KykVmJ4Iv2US5nak3ixc2B+7Km7JTNhQ8kSQ==", "dev": true, "dependencies": { - "@vue/compiler-core": "3.4.38", - "@vue/shared": "3.4.38" + "@vue/compiler-core": "3.5.1", + "@vue/shared": "3.5.1" } }, "node_modules/@vue/compiler-sfc": { - "version": "3.4.38", - "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.4.38.tgz", - "integrity": "sha512-s5QfZ+9PzPh3T5H4hsQDJtI8x7zdJaew/dCGgqZ2630XdzaZ3AD8xGZfBqpT8oaD/p2eedd+pL8tD5vvt5ZYJQ==", + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.5.1.tgz", + "integrity": "sha512-DFizMNH8eDglLhlfwJ0+ciBsztaYe3fY/zcZjrqL1ljXvUw/UpC84M1d7HpBTCW68SNqZyIxrs1XWmf+73Y65w==", "dev": true, "dependencies": { - "@babel/parser": "^7.24.7", - "@vue/compiler-core": "3.4.38", - "@vue/compiler-dom": "3.4.38", - "@vue/compiler-ssr": "3.4.38", - "@vue/shared": "3.4.38", + "@babel/parser": "^7.25.3", + "@vue/compiler-core": "3.5.1", + "@vue/compiler-dom": "3.5.1", + "@vue/compiler-ssr": "3.5.1", + "@vue/shared": "3.5.1", "estree-walker": "^2.0.2", - "magic-string": "^0.30.10", - "postcss": "^8.4.40", + "magic-string": "^0.30.11", + "postcss": "^8.4.44", "source-map-js": "^1.2.0" } }, "node_modules/@vue/compiler-ssr": { - "version": "3.4.38", - "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.4.38.tgz", - "integrity": "sha512-YXznKFQ8dxYpAz9zLuVvfcXhc31FSPFDcqr0kyujbOwNhlmaNvL2QfIy+RZeJgSn5Fk54CWoEUeW+NVBAogGaw==", + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.5.1.tgz", + "integrity": "sha512-C1hpSHQgRM8bg+5XWWD7CkFaVpSn9wZHCLRd10AmxqrH17d4EMP6+XcZpwBOM7H1jeStU5naEapZZWX0kso1tQ==", "dev": true, "dependencies": { - "@vue/compiler-dom": "3.4.38", - "@vue/shared": "3.4.38" + "@vue/compiler-dom": "3.5.1", + "@vue/shared": "3.5.1" } }, "node_modules/@vue/reactivity": { - "version": "3.4.38", - "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.4.38.tgz", - "integrity": "sha512-4vl4wMMVniLsSYYeldAKzbk72+D3hUnkw9z8lDeJacTxAkXeDAP1uE9xr2+aKIN0ipOL8EG2GPouVTH6yF7Gnw==", + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.5.1.tgz", + "integrity": "sha512-aFE1nMDfbG7V+U5vdOk/NXxH/WX78XuAfX59vWmCM7Ao4lieoc83RkzOAWun61sQXlzNZ4IgROovFBHg+Iz1+Q==", "dev": true, "dependencies": { - "@vue/shared": "3.4.38" + "@vue/shared": "3.5.1" } }, "node_modules/@vue/runtime-core": { - "version": "3.4.38", - "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.4.38.tgz", - "integrity": "sha512-21z3wA99EABtuf+O3IhdxP0iHgkBs1vuoCAsCKLVJPEjpVqvblwBnTj42vzHRlWDCyxu9ptDm7sI2ZMcWrQqlA==", + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.5.1.tgz", + "integrity": "sha512-Ce92CCholNRHR3ZtzpRp/7CDGIPFxQ7ElXt9iH91ilK5eOrUv3Z582NWJesuM3aYX71BujVG5/4ypUxigGNxjA==", "dev": true, "dependencies": { - "@vue/reactivity": "3.4.38", - "@vue/shared": "3.4.38" + "@vue/reactivity": "3.5.1", + "@vue/shared": "3.5.1" } }, "node_modules/@vue/runtime-dom": { - "version": "3.4.38", - "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.4.38.tgz", - "integrity": "sha512-afZzmUreU7vKwKsV17H1NDThEEmdYI+GCAK/KY1U957Ig2NATPVjCROv61R19fjZNzMmiU03n79OMnXyJVN0UA==", + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.5.1.tgz", + "integrity": "sha512-B/fUJfBLp5PwE0EWNfBYnA4JUea8Yufb3wN8fN0/HzaqBdkiRHh4sFHOjWqIY8GS75gj//8VqeEqhcU6yUjIkA==", "dev": true, "dependencies": { - "@vue/reactivity": "3.4.38", - "@vue/runtime-core": "3.4.38", - "@vue/shared": "3.4.38", + "@vue/reactivity": "3.5.1", + "@vue/runtime-core": "3.5.1", + "@vue/shared": "3.5.1", "csstype": "^3.1.3" } }, "node_modules/@vue/server-renderer": { - "version": "3.4.38", - "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.4.38.tgz", - "integrity": "sha512-NggOTr82FbPEkkUvBm4fTGcwUY8UuTsnWC/L2YZBmvaQ4C4Jl/Ao4HHTB+l7WnFCt5M/dN3l0XLuyjzswGYVCA==", + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.5.1.tgz", + "integrity": "sha512-C5V/fjQTitgVaRNH5wCoHynaWysjZ+VH68drNsAvQYg4ArHsZUQNz0nHoEWRj41nzqkVn2RUlnWaEOTl2o1Ppg==", "dev": true, "dependencies": { - "@vue/compiler-ssr": "3.4.38", - "@vue/shared": "3.4.38" + "@vue/compiler-ssr": "3.5.1", + "@vue/shared": "3.5.1" }, "peerDependencies": { - "vue": "3.4.38" + "vue": "3.5.1" } }, "node_modules/@vue/shared": { - "version": "3.4.38", - "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.38.tgz", - "integrity": "sha512-q0xCiLkuWWQLzVrecPb0RMsNWyxICOjPrcrwxTUEHb1fsnvni4dcuyG7RT/Ie7VPTvnjzIaWzRMUBsrqNj/hhw==", + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.5.1.tgz", + "integrity": "sha512-NdcTRoO4KuW2RSFgpE2c+E/R/ZHaRzWPxAGxhmxZaaqLh6nYCXx7lc9a88ioqOCxCaV2SFJmujkxbUScW7dNsQ==", "dev": true }, "node_modules/ansi-regex": { @@ -1014,9 +1014,9 @@ } }, "node_modules/axios": { - "version": "1.7.5", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.5.tgz", - "integrity": "sha512-fZu86yCo+svH3uqJ/yTdQ0QHpQu5oL+/QE+QPSv6BZSkDAoky9vytxp7u5qk83OJFS3kEBcesWni9WTZAv3tSw==", + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz", + "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==", "dev": true, "dependencies": { "follow-redirects": "^1.15.6", @@ -1124,9 +1124,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001653", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001653.tgz", - "integrity": "sha512-XGWQVB8wFQ2+9NZwZ10GxTYC5hk0Fa+q8cSkr0tgvMhYhMHP/QC+WTgrePMDBWiWc/pV+1ik82Al20XOK25Gcw==", + "version": "1.0.30001655", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001655.tgz", + "integrity": "sha512-jRGVy3iSGO5Uutn2owlb5gR6qsGngTw9ZTb4ali9f3glshcNmJ2noam4Mo9zia5P9Dk3jNNydy7vQjuE5dQmfg==", "dev": true, "funding": [ { @@ -1310,9 +1310,9 @@ "dev": true }, "node_modules/electron-to-chromium": { - "version": "1.5.13", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.13.tgz", - "integrity": "sha512-lbBcvtIJ4J6sS4tb5TLp1b4LyfCdMkwStzXPyAgVgTRAsep4bvrAGaBOP7ZJtQMNJpSQ9SqG4brWOroNaQtm7Q==", + "version": "1.5.14", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.14.tgz", + "integrity": "sha512-bEfPECb3fJ15eaDnu9LEJ2vPGD6W1vt7vZleSVyFhYuMIKm3vz/g9lt7IvEzgdwj58RjbPKUF2rXTCN/UW47tQ==", "dev": true }, "node_modules/emoji-regex": { @@ -1393,9 +1393,9 @@ } }, "node_modules/escalade": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", - "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", "dev": true, "engines": { "node": ">=6" @@ -1457,9 +1457,9 @@ } }, "node_modules/follow-redirects": { - "version": "1.15.6", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", - "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", + "version": "1.15.8", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.8.tgz", + "integrity": "sha512-xgrmBhBToVKay1q2Tao5LI26B83UhrB/vM1avwVSDzt8rx3rO6AizBAaF46EgksTVr+rFTQaqZZ9MVBfUe4nig==", "dev": true, "funding": [ { @@ -2013,9 +2013,9 @@ } }, "node_modules/picocolors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", - "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.0.tgz", + "integrity": "sha512-TQ92mBOW0l3LeMeyLV6mzy/kWr8lkd/hp3mTg7wYK7zJhuBStmGMBG0BdeDZS/dZx1IukaX6Bk11zcln25o1Aw==", "dev": true }, "node_modules/picomatch": { @@ -2049,9 +2049,9 @@ } }, "node_modules/postcss": { - "version": "8.4.41", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.41.tgz", - "integrity": "sha512-TesUflQ0WKZqAvg52PWL6kHgLKP6xB6heTOdoYM0Wt2UHyxNa4K25EZZMgKns3BH1RLVbZCREPpLY0rhnNoHVQ==", + "version": "8.4.45", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.45.tgz", + "integrity": "sha512-7KTLTdzdZZYscUc65XmjFiB73vBhBfbPztCYdUNvlaso9PrzjzcmjqBPR0lNGkcVlcO4BjiO5rK/qNz+XAen1Q==", "dev": true, "funding": [ { @@ -2293,9 +2293,9 @@ } }, "node_modules/rollup": { - "version": "4.21.1", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.21.1.tgz", - "integrity": "sha512-ZnYyKvscThhgd3M5+Qt3pmhO4jIRR5RGzaSovB6Q7rGNrK5cUncrtLmcTTJVSdcKXyZjW8X8MB0JMSuH9bcAJg==", + "version": "4.21.2", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.21.2.tgz", + "integrity": "sha512-e3TapAgYf9xjdLvKQCkQTnbTKd4a6jwlpQSJJFokHGaX2IVjoEqkIIhiQfqsi0cdwlOD+tQGuOd5AJkc5RngBw==", "dev": true, "dependencies": { "@types/estree": "1.0.5" @@ -2308,22 +2308,22 @@ "npm": ">=8.0.0" }, "optionalDependencies": { - "@rollup/rollup-android-arm-eabi": "4.21.1", - "@rollup/rollup-android-arm64": "4.21.1", - "@rollup/rollup-darwin-arm64": "4.21.1", - "@rollup/rollup-darwin-x64": "4.21.1", - "@rollup/rollup-linux-arm-gnueabihf": "4.21.1", - "@rollup/rollup-linux-arm-musleabihf": "4.21.1", - "@rollup/rollup-linux-arm64-gnu": "4.21.1", - "@rollup/rollup-linux-arm64-musl": "4.21.1", - "@rollup/rollup-linux-powerpc64le-gnu": "4.21.1", - "@rollup/rollup-linux-riscv64-gnu": "4.21.1", - "@rollup/rollup-linux-s390x-gnu": "4.21.1", - "@rollup/rollup-linux-x64-gnu": "4.21.1", - "@rollup/rollup-linux-x64-musl": "4.21.1", - "@rollup/rollup-win32-arm64-msvc": "4.21.1", - "@rollup/rollup-win32-ia32-msvc": "4.21.1", - "@rollup/rollup-win32-x64-msvc": "4.21.1", + "@rollup/rollup-android-arm-eabi": "4.21.2", + "@rollup/rollup-android-arm64": "4.21.2", + "@rollup/rollup-darwin-arm64": "4.21.2", + "@rollup/rollup-darwin-x64": "4.21.2", + "@rollup/rollup-linux-arm-gnueabihf": "4.21.2", + "@rollup/rollup-linux-arm-musleabihf": "4.21.2", + "@rollup/rollup-linux-arm64-gnu": "4.21.2", + "@rollup/rollup-linux-arm64-musl": "4.21.2", + "@rollup/rollup-linux-powerpc64le-gnu": "4.21.2", + "@rollup/rollup-linux-riscv64-gnu": "4.21.2", + "@rollup/rollup-linux-s390x-gnu": "4.21.2", + "@rollup/rollup-linux-x64-gnu": "4.21.2", + "@rollup/rollup-linux-x64-musl": "4.21.2", + "@rollup/rollup-win32-arm64-msvc": "4.21.2", + "@rollup/rollup-win32-ia32-msvc": "4.21.2", + "@rollup/rollup-win32-x64-msvc": "4.21.2", "fsevents": "~2.3.2" } }, @@ -2558,9 +2558,9 @@ } }, "node_modules/sweetalert2": { - "version": "11.12.4", - "resolved": "https://registry.npmjs.org/sweetalert2/-/sweetalert2-11.12.4.tgz", - "integrity": "sha512-ZSpyaLbAmn4b7xjnV9x9BFD1UOrCAhIzm1D8dZ443kGxtVKqbTIA5SgXs4xeEtmFfEXUyC3RBgpSlu1AXmCiHA==", + "version": "11.13.2", + "resolved": "https://registry.npmjs.org/sweetalert2/-/sweetalert2-11.13.2.tgz", + "integrity": "sha512-Q361QVJrDce3pA+46m2JmfDQyxxlmVE6t7ScoMwubm2PQKTlUqaMpzWq/DZRSPL8Sg2hUCzUAXQ9dwMPnbsy7Q==", "dev": true, "funding": { "type": "individual", @@ -2689,13 +2689,13 @@ "dev": true }, "node_modules/vite": { - "version": "5.4.2", - "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.2.tgz", - "integrity": "sha512-dDrQTRHp5C1fTFzcSaMxjk6vdpKvT+2/mIdE07Gw2ykehT49O0z/VHS3zZ8iV/Gh8BJJKHWOe5RjaNrW5xf/GA==", + "version": "5.4.3", + "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.3.tgz", + "integrity": "sha512-IH+nl64eq9lJjFqU+/yrRnrHPVTlgy42/+IzbOdaFDVlyLgI/wDlf+FCobXLX1cT0X5+7LMyH1mIy2xJdLfo8Q==", "dev": true, "dependencies": { "esbuild": "^0.21.3", - "postcss": "^8.4.41", + "postcss": "^8.4.43", "rollup": "^4.20.0" }, "bin": { @@ -2758,16 +2758,16 @@ } }, "node_modules/vue": { - "version": "3.4.38", - "resolved": "https://registry.npmjs.org/vue/-/vue-3.4.38.tgz", - "integrity": "sha512-f0ZgN+mZ5KFgVv9wz0f4OgVKukoXtS3nwET4c2vLBGQR50aI8G0cqbFtLlX9Yiyg3LFGBitruPHt2PxwTduJEw==", + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/vue/-/vue-3.5.1.tgz", + "integrity": "sha512-k4UNnbPOEskodSxMtv+B9GljdB0C9ubZDOmW6vnXVGIfMqmEsY2+ohasjGguhGkMkrcP/oOrbH0dSD41x5JQFw==", "dev": true, "dependencies": { - "@vue/compiler-dom": "3.4.38", - "@vue/compiler-sfc": "3.4.38", - "@vue/runtime-dom": "3.4.38", - "@vue/server-renderer": "3.4.38", - "@vue/shared": "3.4.38" + "@vue/compiler-dom": "3.5.1", + "@vue/compiler-sfc": "3.5.1", + "@vue/runtime-dom": "3.5.1", + "@vue/server-renderer": "3.5.1", + "@vue/shared": "3.5.1" }, "peerDependencies": { "typescript": "*" @@ -2885,9 +2885,9 @@ } }, "node_modules/yaml": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.5.0.tgz", - "integrity": "sha512-2wWLbGbYDiSqqIKoPjar3MPgB94ErzCtrNE1FdqGuaO0pi2JGjmE8aW8TDZwzU7vuxcGRdL/4gPQwQ7hD5AMSw==", + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.5.1.tgz", + "integrity": "sha512-bLQOjaX/ADgQ20isPJRvF0iRUHIxVhYvr53Of7wGcWlO2jvtUlH5m87DsmulFVxRpNLOnI4tB6p/oh8D7kpn9Q==", "dev": true, "bin": { "yaml": "bin.mjs" diff --git a/resources/css/app.css b/resources/css/app.css index 13bbfe2..68f59f0 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -1,4 +1,4 @@ -@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@200..700&display=swap'); +@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@200..700&display=swap'); @tailwind base; @tailwind components; @@ -6,7 +6,7 @@ body{ - font-family: "Oswald", sans-serif; + font-family: "Open Sans", sans-serif; @apply text-gray-800 font-light; } diff --git a/resources/js/Pages/Admin/Users/User.vue b/resources/js/Pages/Admin/Users/User.vue index 5f5ae3b..4e5bbbb 100644 --- a/resources/js/Pages/Admin/Users/User.vue +++ b/resources/js/Pages/Admin/Users/User.vue @@ -34,13 +34,17 @@ function createPAT() { newPAT.value.user_id = user.value.id axios.post('/admin/user-personal-access-tokens', newPAT.value).then(response => { let token = response.data.data.token + let secret = response.data.data.secret Swal.fire({ title: "Personal access token issued!", - html: `Please note that the token will be displayed only once. Make sure to save it securely. </br> <b>` + token + `</b>`, + html: '<div>Please note that the token will be displayed only once. Make sure to save it securely.</div>' + + '<div class="mt-4">Token: <b>' + token + '</b></div>' + + '<div class="mt-4">Secret: <b>' + secret + '</b></div>' + + '<div class="mt-4 text-xs">You will need the secret in order to sign your API requests.</div>', icon: "warning", confirmButtonColor: "#3085d6", - confirmButtonText: "Got it" + confirmButtonText: "Got it!" }).then((result) => { newPAT.value = {name: '', token_abilities: []} getUser() diff --git a/resources/views/scribe/index.blade.php b/resources/views/scribe/index.blade.php index 16a1636..8ae33ed 100644 --- a/resources/views/scribe/index.blade.php +++ b/resources/views/scribe/index.blade.php @@ -163,14 +163,6 @@ class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0">Introduction</a> class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-4 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none"> <a href="#authenticating-requests" class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0">Authenticating requests</a> - </div> - - </div> - <div class="expandable"> - <div title="/my-team" id="toc-item-my-team" - class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-4 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none"> - <a href="#my-team" - class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0">/my-team</a> <div class="sl-flex sl-items-center sl-text-xs expansion-chevrons"> <svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="chevron-right" @@ -185,11 +177,23 @@ class="svg-inline--fa fa-chevron-right fa-fw sl-icon sl-text-muted" <div class="children" style="display: none;"> <div class="expandable"> <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" - id="toc-item-my-team-GETapi-v1-my-team"> - <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="GET /"> + id="toc-item-about-api-credentials"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="About API Credentials"> <a class="ElementsTableOfContentsItem sl-block sl-no-underline" - href="#my-team-GETapi-v1-my-team"> - GET / + href="#about-api-credentials"> + About API Credentials + </a> + </div> + </div> + + </div> + <div class="expandable"> + <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" + id="toc-item-signing-your-requests"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="Signing Your requests"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#signing-your-requests"> + Signing Your requests </a> </div> </div> @@ -198,10 +202,10 @@ class="svg-inline--fa fa-chevron-right fa-fw sl-icon sl-text-muted" </div> </div> <div class="expandable"> - <div title="/my-team-vouchers" id="toc-item-my-team-vouchers" + <div title="App Endpoints" id="toc-item-app-endpoints" class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-4 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none"> - <a href="#my-team-vouchers" - class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0">/my-team-vouchers</a> + <a href="#app-endpoints" + class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0">App Endpoints</a> <div class="sl-flex sl-items-center sl-text-xs expansion-chevrons"> <svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="chevron-right" @@ -216,97 +220,212 @@ class="svg-inline--fa fa-chevron-right fa-fw sl-icon sl-text-muted" <div class="children" style="display: none;"> <div class="expandable"> <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" - id="toc-item-my-team-vouchers-GETapi-v1-my-team-vouchers"> - <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="GET /"> + id="toc-item-app-endpoints-my-team"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="/my-team"> <a class="ElementsTableOfContentsItem sl-block sl-no-underline" - href="#my-team-vouchers-GETapi-v1-my-team-vouchers"> - GET / + href="#app-endpoints-my-team"> + /my-team </a> </div> + <div class="sl-flex sl-items-center sl-text-xs expansion-chevrons"> + <svg aria-hidden="true" focusable="false" data-prefix="fas" + data-icon="chevron-right" + class="svg-inline--fa fa-chevron-right fa-fw sl-icon sl-text-muted" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"> + <path fill="currentColor" + d="M96 480c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L242.8 256L73.38 86.63c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l192 192c12.5 12.5 12.5 32.75 0 45.25l-192 192C112.4 476.9 104.2 480 96 480z"></path> + </svg> + </div> </div> + <div class="children" style="display: none;"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#app-endpoints-GETapi-v1-my-team"> + <div title="GET /" id="toc-item-app-endpoints-GETapi-v1-my-team" + class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-12 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none"> + GET / + </div> + </a> + </div> </div> <div class="expandable"> <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" - id="toc-item-my-team-vouchers-GETapi-v1-my-team-vouchers--id-"> - <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="GET /{id}"> + id="toc-item-app-endpoints-my-teams"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="/my-teams"> <a class="ElementsTableOfContentsItem sl-block sl-no-underline" - href="#my-team-vouchers-GETapi-v1-my-team-vouchers--id-"> - GET /{id} + href="#app-endpoints-my-teams"> + /my-teams </a> </div> + <div class="sl-flex sl-items-center sl-text-xs expansion-chevrons"> + <svg aria-hidden="true" focusable="false" data-prefix="fas" + data-icon="chevron-right" + class="svg-inline--fa fa-chevron-right fa-fw sl-icon sl-text-muted" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"> + <path fill="currentColor" + d="M96 480c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L242.8 256L73.38 86.63c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l192 192c12.5 12.5 12.5 32.75 0 45.25l-192 192C112.4 476.9 104.2 480 96 480z"></path> + </svg> + </div> </div> + <div class="children" style="display: none;"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#app-endpoints-GETapi-v1-my-teams"> + <div title="GET /" id="toc-item-app-endpoints-GETapi-v1-my-teams" + class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-12 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none"> + GET / + </div> + </a> + </div> </div> - </div> + <div class="expandable"> + <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" + id="toc-item-app-endpoints-my-team-audit-items"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="/my-team-audit-items"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#app-endpoints-my-team-audit-items"> + /my-team-audit-items + </a> </div> - <div class="expandable"> - <div title="/my-teams" id="toc-item-my-teams" - class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-4 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none"> - <a href="#my-teams" - class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0">/my-teams</a> - <div class="sl-flex sl-items-center sl-text-xs expansion-chevrons"> - <svg aria-hidden="true" focusable="false" data-prefix="fas" - data-icon="chevron-right" - class="svg-inline--fa fa-chevron-right fa-fw sl-icon sl-text-muted" - xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"> - <path fill="currentColor" - d="M96 480c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L242.8 256L73.38 86.63c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l192 192c12.5 12.5 12.5 32.75 0 45.25l-192 192C112.4 476.9 104.2 480 96 480z"></path> - </svg> - </div> - </div> + <div class="sl-flex sl-items-center sl-text-xs expansion-chevrons"> + <svg aria-hidden="true" focusable="false" data-prefix="fas" + data-icon="chevron-right" + class="svg-inline--fa fa-chevron-right fa-fw sl-icon sl-text-muted" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"> + <path fill="currentColor" + d="M96 480c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L242.8 256L73.38 86.63c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l192 192c12.5 12.5 12.5 32.75 0 45.25l-192 192C112.4 476.9 104.2 480 96 480z"></path> + </svg> + </div> + </div> - <div class="children" style="display: none;"> + <div class="children" style="display: none;"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#app-endpoints-GETapi-v1-my-team-audit-items"> + <div title="GET /" id="toc-item-app-endpoints-GETapi-v1-my-team-audit-items" + class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-12 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none"> + GET / + </div> + </a> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#app-endpoints-GETapi-v1-my-team-audit-items--id-"> + <div title="GET /{id}" id="toc-item-app-endpoints-GETapi-v1-my-team-audit-items--id-" + class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-12 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none"> + GET /{id} + </div> + </a> + </div> + </div> <div class="expandable"> <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" - id="toc-item-my-teams-GETapi-v1-my-teams"> - <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="GET /"> + id="toc-item-app-endpoints-my-team-vouchers"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="/my-team-vouchers"> <a class="ElementsTableOfContentsItem sl-block sl-no-underline" - href="#my-teams-GETapi-v1-my-teams"> - GET / + href="#app-endpoints-my-team-vouchers"> + /my-team-vouchers </a> </div> + <div class="sl-flex sl-items-center sl-text-xs expansion-chevrons"> + <svg aria-hidden="true" focusable="false" data-prefix="fas" + data-icon="chevron-right" + class="svg-inline--fa fa-chevron-right fa-fw sl-icon sl-text-muted" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"> + <path fill="currentColor" + d="M96 480c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L242.8 256L73.38 86.63c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l192 192c12.5 12.5 12.5 32.75 0 45.25l-192 192C112.4 476.9 104.2 480 96 480z"></path> + </svg> + </div> </div> + <div class="children" style="display: none;"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#app-endpoints-GETapi-v1-my-team-vouchers"> + <div title="GET /" id="toc-item-app-endpoints-GETapi-v1-my-team-vouchers" + class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-12 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none"> + GET / + </div> + </a> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#app-endpoints-GETapi-v1-my-team-vouchers--id-"> + <div title="GET /{id}" id="toc-item-app-endpoints-GETapi-v1-my-team-vouchers--id-" + class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-12 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none"> + GET /{id} + </div> + </a> + </div> </div> - </div> + <div class="expandable"> + <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" + id="toc-item-app-endpoints-system-statistics"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="/system-statistics"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#app-endpoints-system-statistics"> + /system-statistics + </a> </div> - <div class="expandable"> - <div title="/shops" id="toc-item-shops" - class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-4 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none"> - <a href="#shops" - class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0">/shops</a> - <div class="sl-flex sl-items-center sl-text-xs expansion-chevrons"> - <svg aria-hidden="true" focusable="false" data-prefix="fas" - data-icon="chevron-right" - class="svg-inline--fa fa-chevron-right fa-fw sl-icon sl-text-muted" - xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"> - <path fill="currentColor" - d="M96 480c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L242.8 256L73.38 86.63c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l192 192c12.5 12.5 12.5 32.75 0 45.25l-192 192C112.4 476.9 104.2 480 96 480z"></path> - </svg> - </div> - </div> + <div class="sl-flex sl-items-center sl-text-xs expansion-chevrons"> + <svg aria-hidden="true" focusable="false" data-prefix="fas" + data-icon="chevron-right" + class="svg-inline--fa fa-chevron-right fa-fw sl-icon sl-text-muted" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"> + <path fill="currentColor" + d="M96 480c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L242.8 256L73.38 86.63c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l192 192c12.5 12.5 12.5 32.75 0 45.25l-192 192C112.4 476.9 104.2 480 96 480z"></path> + </svg> + </div> + </div> - <div class="children" style="display: none;"> + <div class="children" style="display: none;"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#app-endpoints-GETapi-v1-system-statistics"> + <div title="GET /" id="toc-item-app-endpoints-GETapi-v1-system-statistics" + class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-12 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none"> + GET / + </div> + </a> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#app-endpoints-GETapi-v1-system-statistics--id-"> + <div title="GET /{id}" id="toc-item-app-endpoints-GETapi-v1-system-statistics--id-" + class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-12 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none"> + GET /{id} + </div> + </a> + </div> + </div> <div class="expandable"> <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" - id="toc-item-shops-POSTapi-v1-shops"> - <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="POST /"> + id="toc-item-app-endpoints-shops"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="/shops"> <a class="ElementsTableOfContentsItem sl-block sl-no-underline" - href="#shops-POSTapi-v1-shops"> - POST / + href="#app-endpoints-shops"> + /shops </a> </div> + <div class="sl-flex sl-items-center sl-text-xs expansion-chevrons"> + <svg aria-hidden="true" focusable="false" data-prefix="fas" + data-icon="chevron-right" + class="svg-inline--fa fa-chevron-right fa-fw sl-icon sl-text-muted" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"> + <path fill="currentColor" + d="M96 480c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L242.8 256L73.38 86.63c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l192 192c12.5 12.5 12.5 32.75 0 45.25l-192 192C112.4 476.9 104.2 480 96 480z"></path> + </svg> + </div> </div> + <div class="children" style="display: none;"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#app-endpoints-POSTapi-v1-shops"> + <div title="POST /" id="toc-item-app-endpoints-POSTapi-v1-shops" + class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-12 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none"> + POST / + </div> + </a> + </div> </div> </div> </div> <div class="expandable"> - <div title="/system-statistics" id="toc-item-system-statistics" + <div title="Endpoints" id="toc-item-endpoints" class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-4 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none"> - <a href="#system-statistics" - class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0">/system-statistics</a> + <a href="#endpoints" + class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0">Endpoints</a> <div class="sl-flex sl-items-center sl-text-xs expansion-chevrons"> <svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="chevron-right" @@ -321,10 +440,10 @@ class="svg-inline--fa fa-chevron-right fa-fw sl-icon sl-text-muted" <div class="children" style="display: none;"> <div class="expandable"> <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" - id="toc-item-system-statistics-GETapi-v1-system-statistics"> + id="toc-item-endpoints-GETapi-v1-admin-audit-items"> <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="GET /"> <a class="ElementsTableOfContentsItem sl-block sl-no-underline" - href="#system-statistics-GETapi-v1-system-statistics"> + href="#endpoints-GETapi-v1-admin-audit-items"> GET / </a> </div> @@ -333,42 +452,47 @@ class="svg-inline--fa fa-chevron-right fa-fw sl-icon sl-text-muted" </div> <div class="expandable"> <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" - id="toc-item-system-statistics-GETapi-v1-system-statistics--id-"> + id="toc-item-endpoints-POSTapi-v1-admin-audit-items"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="POST /"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#endpoints-POSTapi-v1-admin-audit-items"> + POST / + </a> + </div> + </div> + + </div> + <div class="expandable"> + <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" + id="toc-item-endpoints-GETapi-v1-admin-audit-items--id-"> <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="GET /{id}"> <a class="ElementsTableOfContentsItem sl-block sl-no-underline" - href="#system-statistics-GETapi-v1-system-statistics--id-"> + href="#endpoints-GETapi-v1-admin-audit-items--id-"> GET /{id} </a> </div> </div> </div> - </div> + <div class="expandable"> + <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" + id="toc-item-endpoints-PUTapi-v1-admin-audit-items--id-"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="PUT /{id}"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#endpoints-PUTapi-v1-admin-audit-items--id-"> + PUT /{id} + </a> </div> - <div class="expandable"> - <div title="Endpoints" id="toc-item-endpoints" - class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-4 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none"> - <a href="#endpoints" - class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0">Endpoints</a> - <div class="sl-flex sl-items-center sl-text-xs expansion-chevrons"> - <svg aria-hidden="true" focusable="false" data-prefix="fas" - data-icon="chevron-right" - class="svg-inline--fa fa-chevron-right fa-fw sl-icon sl-text-muted" - xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"> - <path fill="currentColor" - d="M96 480c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L242.8 256L73.38 86.63c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l192 192c12.5 12.5 12.5 32.75 0 45.25l-192 192C112.4 476.9 104.2 480 96 480z"></path> - </svg> - </div> - </div> + </div> - <div class="children" style="display: none;"> + </div> <div class="expandable"> <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" - id="toc-item-endpoints-POSTapi-v1-my-team-audit-items"> - <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="POST /"> + id="toc-item-endpoints-DELETEapi-v1-admin-audit-items--id-"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="DELETE / {id}"> <a class="ElementsTableOfContentsItem sl-block sl-no-underline" - href="#endpoints-POSTapi-v1-my-team-audit-items"> - POST / + href="#endpoints-DELETEapi-v1-admin-audit-items--id-"> + DELETE / {id} </a> </div> </div> @@ -376,10 +500,10 @@ class="svg-inline--fa fa-chevron-right fa-fw sl-icon sl-text-muted" </div> <div class="expandable"> <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" - id="toc-item-endpoints-GETapi-v1-my-team-audit-items"> + id="toc-item-endpoints-GETapi-v1-admin-search"> <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="GET /"> <a class="ElementsTableOfContentsItem sl-block sl-no-underline" - href="#endpoints-GETapi-v1-my-team-audit-items"> + href="#endpoints-GETapi-v1-admin-search"> GET / </a> </div> @@ -388,10 +512,22 @@ class="svg-inline--fa fa-chevron-right fa-fw sl-icon sl-text-muted" </div> <div class="expandable"> <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" - id="toc-item-endpoints-GETapi-v1-my-team-audit-items--id-"> + id="toc-item-endpoints-POSTapi-v1-admin-search"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="POST /"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#endpoints-POSTapi-v1-admin-search"> + POST / + </a> + </div> + </div> + + </div> + <div class="expandable"> + <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" + id="toc-item-endpoints-GETapi-v1-admin-search--id-"> <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="GET /{id}"> <a class="ElementsTableOfContentsItem sl-block sl-no-underline" - href="#endpoints-GETapi-v1-my-team-audit-items--id-"> + href="#endpoints-GETapi-v1-admin-search--id-"> GET /{id} </a> </div> @@ -400,86 +536,13345 @@ class="svg-inline--fa fa-chevron-right fa-fw sl-icon sl-text-muted" </div> <div class="expandable"> <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" - id="toc-item-endpoints-DELETEapi-v1-my-team-audit-items--id-"> + id="toc-item-endpoints-PUTapi-v1-admin-search--id-"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="PUT /{id}"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#endpoints-PUTapi-v1-admin-search--id-"> + PUT /{id} + </a> + </div> + </div> + + </div> + <div class="expandable"> + <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" + id="toc-item-endpoints-DELETEapi-v1-admin-search--id-"> <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="DELETE / {id}"> <a class="ElementsTableOfContentsItem sl-block sl-no-underline" - href="#endpoints-DELETEapi-v1-my-team-audit-items--id-"> + href="#endpoints-DELETEapi-v1-admin-search--id-"> DELETE / {id} </a> </div> </div> </div> - </div> + <div class="expandable"> + <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" + id="toc-item-endpoints-GETapi-v1-admin-system-statistics"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="GET /"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#endpoints-GETapi-v1-admin-system-statistics"> + GET / + </a> </div> - </div> + </div> - </div> - <div class="sl-flex sl-items-center sl-px-4 sl-py-3 sl-border-t"> - Last updated: August 28, 2024 - </div> + </div> + <div class="expandable"> + <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" + id="toc-item-endpoints-POSTapi-v1-admin-system-statistics"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="POST /"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#endpoints-POSTapi-v1-admin-system-statistics"> + POST / + </a> + </div> + </div> - <div class="sl-flex sl-items-center sl-px-4 sl-py-3 sl-border-t"> - <a href="http://github.com/knuckleswtf/scribe">Documentation powered by Scribe ✍</a> - </div> - </div> -</div> + </div> + <div class="expandable"> + <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" + id="toc-item-endpoints-GETapi-v1-admin-system-statistics--id-"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="GET /{id}"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#endpoints-GETapi-v1-admin-system-statistics--id-"> + GET /{id} + </a> + </div> + </div> - <div class="sl-overflow-y-auto sl-flex-1 sl-w-full sl-px-16 sl-bg-canvas sl-py-16" style="max-width: 1500px;"> + </div> + <div class="expandable"> + <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" + id="toc-item-endpoints-PUTapi-v1-admin-system-statistics--id-"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="PUT /{id}"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#endpoints-PUTapi-v1-admin-system-statistics--id-"> + PUT /{id} + </a> + </div> + </div> - <div class="sl-mb-10"> - <div class="sl-mb-4"> - <h1 class="sl-text-5xl sl-leading-tight sl-font-prose sl-font-semibold sl-text-heading"> - Open Food Network Vine Platform - API Documentation - </h1> - <a title="Download Postman collection" class="sl-mx-1" - href="{{ route("scribe.postman") }}" target="_blank"> - <small>Postman collection →</small> - </a> - <a title="Download OpenAPI spec" class="sl-mx-1" - href="{{ route("scribe.openapi") }}" target="_blank"> - <small>OpenAPI spec →</small> - </a> - </div> + </div> + <div class="expandable"> + <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" + id="toc-item-endpoints-DELETEapi-v1-admin-system-statistics--id-"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="DELETE / {id}"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#endpoints-DELETEapi-v1-admin-system-statistics--id-"> + DELETE / {id} + </a> + </div> + </div> - <div class="sl-prose sl-markdown-viewer sl-my-4"> - <h1 id="introduction">Introduction</h1> -<p>The API documentation for Open Food Network Vine Platform.</p> -<aside> - <strong>Base URL</strong>: <code>https://vine.openfoodnetwork.org.au</code> -</aside> -<p>This documentation aims to provide all the information you need to work with our API.</p> -<aside>As you scroll, you'll see code examples for working with the API in different programming languages in the dark area to the right (or as part of the content on mobile). -You can switch the language used with the tabs at the top right (or from the nav menu at the top left on mobile).</aside> + </div> + <div class="expandable"> + <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" + id="toc-item-endpoints-GETapi-v1-admin-team-merchant-teams"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="GET /"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#endpoints-GETapi-v1-admin-team-merchant-teams"> + GET / + </a> + </div> + </div> - <h1 id="authenticating-requests">Authenticating requests</h1> -<p>To authenticate requests, include an <strong><code>Authorization</code></strong> header with the value <strong><code>"Bearer {YOUR_API_TOKEN}"</code></strong>.</p> -<p>All authenticated endpoints are marked with a <code>requires authentication</code> badge in the documentation below.</p> -<p>You or your developer will receive an API token from our admins; ensure to keep this somewhere safe.</p> - </div> - </div> + </div> + <div class="expandable"> + <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" + id="toc-item-endpoints-POSTapi-v1-admin-team-merchant-teams"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="POST /"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#endpoints-POSTapi-v1-admin-team-merchant-teams"> + POST / + </a> + </div> + </div> - <h1 id="my-team" - class="sl-text-5xl sl-leading-tight sl-font-prose sl-text-heading" - > - /my-team - </h1> + </div> + <div class="expandable"> + <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" + id="toc-item-endpoints-GETapi-v1-admin-team-merchant-teams--id-"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="GET /{id}"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#endpoints-GETapi-v1-admin-team-merchant-teams--id-"> + GET /{id} + </a> + </div> + </div> - <p>Retrieve your team details.</p> + </div> + <div class="expandable"> + <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" + id="toc-item-endpoints-PUTapi-v1-admin-team-merchant-teams--id-"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="PUT /{id}"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#endpoints-PUTapi-v1-admin-team-merchant-teams--id-"> + PUT /{id} + </a> + </div> + </div> - <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> - <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> - <div class="sl-relative"> - <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> - <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" - id="my-team-GETapi-v1-my-team"> - GET / - </h2> - </div> - </div> + </div> + <div class="expandable"> + <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" + id="toc-item-endpoints-DELETEapi-v1-admin-team-merchant-teams--id-"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="DELETE /{id}"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#endpoints-DELETEapi-v1-admin-team-merchant-teams--id-"> + DELETE /{id} + </a> + </div> + </div> - <div class="sl-relative"> - <div title="https://vine.openfoodnetwork.org.au/api/v1/my-team" + </div> + <div class="expandable"> + <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" + id="toc-item-endpoints-GETapi-v1-admin-team-service-teams"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="GET /"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#endpoints-GETapi-v1-admin-team-service-teams"> + GET / + </a> + </div> + </div> + + </div> + <div class="expandable"> + <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" + id="toc-item-endpoints-POSTapi-v1-admin-team-service-teams"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="POST /"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#endpoints-POSTapi-v1-admin-team-service-teams"> + POST / + </a> + </div> + </div> + + </div> + <div class="expandable"> + <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" + id="toc-item-endpoints-GETapi-v1-admin-team-service-teams--id-"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="GET / {id}"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#endpoints-GETapi-v1-admin-team-service-teams--id-"> + GET / {id} + </a> + </div> + </div> + + </div> + <div class="expandable"> + <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" + id="toc-item-endpoints-PUTapi-v1-admin-team-service-teams--id-"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="PUT/ {id}"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#endpoints-PUTapi-v1-admin-team-service-teams--id-"> + PUT/ {id} + </a> + </div> + </div> + + </div> + <div class="expandable"> + <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" + id="toc-item-endpoints-DELETEapi-v1-admin-team-service-teams--id-"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="DELETE / {id}"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#endpoints-DELETEapi-v1-admin-team-service-teams--id-"> + DELETE / {id} + </a> + </div> + </div> + + </div> + <div class="expandable"> + <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" + id="toc-item-endpoints-GETapi-v1-admin-team-users"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="GET /"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#endpoints-GETapi-v1-admin-team-users"> + GET / + </a> + </div> + </div> + + </div> + <div class="expandable"> + <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" + id="toc-item-endpoints-POSTapi-v1-admin-team-users"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="POST api/v1/admin/team-users"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#endpoints-POSTapi-v1-admin-team-users"> + POST api/v1/admin/team-users + </a> + </div> + </div> + + </div> + <div class="expandable"> + <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" + id="toc-item-endpoints-GETapi-v1-admin-team-users--id-"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="GET api/v1/admin/team-users/{id}"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#endpoints-GETapi-v1-admin-team-users--id-"> + GET api/v1/admin/team-users/{id} + </a> + </div> + </div> + + </div> + <div class="expandable"> + <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" + id="toc-item-endpoints-PUTapi-v1-admin-team-users--id-"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="PUT api/v1/admin/team-users/{id}"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#endpoints-PUTapi-v1-admin-team-users--id-"> + PUT api/v1/admin/team-users/{id} + </a> + </div> + </div> + + </div> + <div class="expandable"> + <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" + id="toc-item-endpoints-DELETEapi-v1-admin-team-users--id-"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="DELETE /{id}"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#endpoints-DELETEapi-v1-admin-team-users--id-"> + DELETE /{id} + </a> + </div> + </div> + + </div> + <div class="expandable"> + <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" + id="toc-item-endpoints-GETapi-v1-admin-teams"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="GET /"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#endpoints-GETapi-v1-admin-teams"> + GET / + </a> + </div> + </div> + + </div> + <div class="expandable"> + <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" + id="toc-item-endpoints-POSTapi-v1-admin-teams"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="POST /"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#endpoints-POSTapi-v1-admin-teams"> + POST / + </a> + </div> + </div> + + </div> + <div class="expandable"> + <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" + id="toc-item-endpoints-GETapi-v1-admin-teams--id-"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="GET / {id}"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#endpoints-GETapi-v1-admin-teams--id-"> + GET / {id} + </a> + </div> + </div> + + </div> + <div class="expandable"> + <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" + id="toc-item-endpoints-PUTapi-v1-admin-teams--id-"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="PUT/ {id}"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#endpoints-PUTapi-v1-admin-teams--id-"> + PUT/ {id} + </a> + </div> + </div> + + </div> + <div class="expandable"> + <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" + id="toc-item-endpoints-DELETEapi-v1-admin-teams--id-"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="DELETE / {id}"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#endpoints-DELETEapi-v1-admin-teams--id-"> + DELETE / {id} + </a> + </div> + </div> + + </div> + <div class="expandable"> + <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" + id="toc-item-endpoints-GETapi-v1-admin-user-personal-access-tokens"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="GET /"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#endpoints-GETapi-v1-admin-user-personal-access-tokens"> + GET / + </a> + </div> + </div> + + </div> + <div class="expandable"> + <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" + id="toc-item-endpoints-POSTapi-v1-admin-user-personal-access-tokens"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="POST /"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#endpoints-POSTapi-v1-admin-user-personal-access-tokens"> + POST / + </a> + </div> + </div> + + </div> + <div class="expandable"> + <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" + id="toc-item-endpoints-GETapi-v1-admin-user-personal-access-tokens--user_personal_access_token-"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="GET / {id}"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#endpoints-GETapi-v1-admin-user-personal-access-tokens--user_personal_access_token-"> + GET / {id} + </a> + </div> + </div> + + </div> + <div class="expandable"> + <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" + id="toc-item-endpoints-PUTapi-v1-admin-user-personal-access-tokens--user_personal_access_token-"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="PUT/ {id}"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#endpoints-PUTapi-v1-admin-user-personal-access-tokens--user_personal_access_token-"> + PUT/ {id} + </a> + </div> + </div> + + </div> + <div class="expandable"> + <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" + id="toc-item-endpoints-DELETEapi-v1-admin-user-personal-access-tokens--user_personal_access_token-"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="DELETE / {id}"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#endpoints-DELETEapi-v1-admin-user-personal-access-tokens--user_personal_access_token-"> + DELETE / {id} + </a> + </div> + </div> + + </div> + <div class="expandable"> + <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" + id="toc-item-endpoints-GETapi-v1-admin-users"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="GET /"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#endpoints-GETapi-v1-admin-users"> + GET / + </a> + </div> + </div> + + </div> + <div class="expandable"> + <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" + id="toc-item-endpoints-POSTapi-v1-admin-users"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="POST /"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#endpoints-POSTapi-v1-admin-users"> + POST / + </a> + </div> + </div> + + </div> + <div class="expandable"> + <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" + id="toc-item-endpoints-GETapi-v1-admin-users--id-"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="GET / {id}"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#endpoints-GETapi-v1-admin-users--id-"> + GET / {id} + </a> + </div> + </div> + + </div> + <div class="expandable"> + <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" + id="toc-item-endpoints-PUTapi-v1-admin-users--id-"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="PUT/ {id}"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#endpoints-PUTapi-v1-admin-users--id-"> + PUT/ {id} + </a> + </div> + </div> + + </div> + <div class="expandable"> + <div class="sl-flex sl-items-center sl-h-md sl-pr-4 sl-pl-8 sl-bg-canvas-100 hover:sl-bg-canvas-200 sl-cursor-pointer sl-select-none" + id="toc-item-endpoints-DELETEapi-v1-admin-users--id-"> + <div class="sl-flex-1 sl-items-center sl-truncate sl-mr-1.5 sl-p-0" title="DELETE / {id}"> + <a class="ElementsTableOfContentsItem sl-block sl-no-underline" + href="#endpoints-DELETEapi-v1-admin-users--id-"> + DELETE / {id} + </a> + </div> + </div> + + </div> + </div> + </div> + </div> + + </div> + <div class="sl-flex sl-items-center sl-px-4 sl-py-3 sl-border-t"> + Last updated: September 5, 2024 + </div> + + <div class="sl-flex sl-items-center sl-px-4 sl-py-3 sl-border-t"> + <a href="http://github.com/knuckleswtf/scribe">Documentation powered by Scribe ✍</a> + </div> + </div> +</div> + + <div class="sl-overflow-y-auto sl-flex-1 sl-w-full sl-px-16 sl-bg-canvas sl-py-16" style="max-width: 1500px;"> + + <div class="sl-mb-10"> + <div class="sl-mb-4"> + <h1 class="sl-text-5xl sl-leading-tight sl-font-prose sl-font-semibold sl-text-heading"> + Open Food Network Vine Platform - API Documentation + </h1> + <a title="Download Postman collection" class="sl-mx-1" + href="{{ route("scribe.postman") }}" target="_blank"> + <small>Postman collection →</small> + </a> + <a title="Download OpenAPI spec" class="sl-mx-1" + href="{{ route("scribe.openapi") }}" target="_blank"> + <small>OpenAPI spec →</small> + </a> + </div> + + <div class="sl-prose sl-markdown-viewer sl-my-4"> + <h1 id="introduction">Introduction</h1> +<p>The API documentation for Open Food Network Vine Platform.</p> +<aside> + <strong>Base URL</strong>: <code>https://vine.openfoodnetwork.org.au</code> +</aside> +<p>This documentation aims to provide all the information you need to work with our API.</p> +<aside>As you scroll, you'll see code examples for working with the API in different programming languages in the dark area to the right (or as part of the content on mobile). +You can switch the language used with the tabs at the top right (or from the nav menu at the top left on mobile).</aside> + + <h1 id="authenticating-requests">Authenticating requests</h1> +<p>To authenticate requests, include an <strong><code>Authorization</code></strong> header with the value <strong><code>"Bearer {YOUR_API_TOKEN}"</code></strong>.</p> +<p>All authenticated endpoints are marked with a <code>requires authentication</code> badge in the documentation below.</p> +<h2 id="about-api-credentials">About API Credentials</h2> +<p>When you receive API credentials, they will be made up of a <code>token</code> and an accompanying <code>secret</code>. Your secret should never be displayed in front end code, or in any version control repositories, for security.</p> +<h2 id="signing-your-requests">Signing Your requests</h2> +<p>All API requests must be signed, to improve API security. To do this, you must generate a <a href="https://jwt.io/introduction">JWT</a> comprising your current request, signed with your API Token secret.</p> +<p>Send the JWT content in the <code>X-Authorization</code> header as follows</p> +<p>All JWTs must have the following claims:</p> +<ul> +<li>iat - <em>current timestamp, in UTC</em> - must not be less than a minute ago</li> +<li>exp - <em>expiry timestamp, in UTC</em> - must not be more than a minute later than iat claim</li> +<li>iss - <em>indicating issuer of the jwt</em></li> +</ul> +<h3 id="generating-a-jwt">Generating a JWT</h3> +<h4 id="php">PHP</h4> +<pre><code class="language-php"> +use Lcobucci\JWT\Encoding\ChainedFormatter; +use Lcobucci\JWT\Encoding\JoseEncoder; +use Lcobucci\JWT\Signer\Hmac\Sha256; +use Lcobucci\JWT\Signer\Key\InMemory; +use Lcobucci\JWT\Token\Builder; + +$tokenBuilder = (new Builder(new JoseEncoder(), ChainedFormatter::default())); +$algorithm = new Sha256(); +$signingKey = InMemory::plainText(YOUR_API_SECRET); +$now = new \DateTimeImmutable(); +$token = $tokenBuilder + ->issuedBy(ISSUING_BODY) + ->issuedAt(now()) + ->expiresAt(now()->addMinute(1)) + ->getToken($algorithm, $signingKey); + +$jwt = $token->toString();</code></pre> +<h4 id="ruby">Ruby</h4> +<pre><code class="language-ruby">require 'jwt' + +# Your secret signing key (must be a strong secret) +signing_key = YOUR_API_SECRET + +# Define the payload (the data you want to encode in the token) +payload = { + iss: YOUR_ISSUING_BODY, # Your issuer + iat: Time.now.to_i # Token issued at time (now) + exp: Time.now.to_i + 60 # Token expiration time (1 minute from now) +} + +# Choose the algorithm for signing (HS256 is common for symmetric signing keys) +algorithm = 'HS256' + +# Generate the JWT +token = JWT.encode(payload, signing_key, algorithm) + +puts "Generated JWT: #{token}"</code></pre> + </div> + </div> + + <h1 id="app-endpoints" + class="sl-text-5xl sl-leading-tight sl-font-prose sl-text-heading" + > + App Endpoints + </h1> + + + + <h2 id="app-endpoints-my-team" + class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-3" + > + /my-team + </h2> + <p>Retrieve your team details.</p> + <br> + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-relative"> + <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> + <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" + id="app-endpoints-GETapi-v1-my-team"> + GET / + </h2> + </div> + </div> + + <div class="sl-relative"> + <div title="https://vine.openfoodnetwork.org.au/api/v1/my-team" + class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" + > + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: green;" + > + GET + </div> + <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> + <div dir="rtl" + class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/my-team</div> + </div> + + <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" + style="background-color: darkred" + >requires authentication + </div> + </div> + </div> + + <p>Retrieve your team. Automatically filtered to your current team.</p> + </div> + <div class="sl-flex"> + <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> + <div class="sl-stack sl-stack--vertical sl-stack--10 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--8 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose"> + Headers + </h3> + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Authorization</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + Bearer {YOUR_API_TOKEN} + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + JWT eyJ0eXAiOiJKV... + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">Query Parameters</h3> + + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">cached</div> + <span class="sl-truncate sl-text-muted">boolean</span> + </div> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>Request the response to be cached. Default: <code>true</code>.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + 1 + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">fields</div> + <span class="sl-truncate sl-text-muted">string</span> + </div> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>Comma-separated list of database fields to return within the object.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + id,created_at + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + </div> + </div> + </div> + + <div data-testid="two-column-right" class="sl-relative sl-w-2/5 sl-ml-16" style="max-width: 500px;"> + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-h-lg"> + <div class="sl--ml-2"> + Example request: + <select class="example-request-lang-toggle sl-text-base" + aria-label="Request Sample Language" + onchange="switchExampleLanguage(event.target.value);"> + <option>bash</option> + <option>javascript</option> + <option>php</option> + <option>python</option> + </select> + </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-bash" + style=""> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-bash">curl --request GET \ + --get "https://vine.openfoodnetwork.org.au/api/v1/my-team?cached=1&fields=id%2Ccreated_at" \ + --header "Authorization: Bearer {YOUR_API_TOKEN}" \ + --header "Content-Type: application/json" \ + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..."</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-javascript" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-javascript">const url = new URL( + "https://vine.openfoodnetwork.org.au/api/v1/my-team" +); + +const params = { + "cached": "1", + "fields": "id,created_at", +}; +Object.keys(params) + .forEach(key => url.searchParams.append(key, params[key])); + +const headers = { + "Authorization": "Bearer {YOUR_API_TOKEN}", + "Content-Type": "application/json", + "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", +}; + +fetch(url, { + method: "GET", + headers, +}).then(response => response.json());</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-php" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-php">$client = new \GuzzleHttp\Client(); +$url = 'https://vine.openfoodnetwork.org.au/api/v1/my-team'; +$response = $client->get( + $url, + [ + 'headers' => [ + 'Authorization' => 'Bearer {YOUR_API_TOKEN}', + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', + ], + 'query' => [ + 'cached' => '1', + 'fields' => 'id,created_at', + ], + ] +); +$body = $response->getBody(); +print_r(json_decode((string) $body));</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-python" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-python">import requests +import json + +url = 'https://vine.openfoodnetwork.org.au/api/v1/my-team' +params = { + 'cached': '1', + 'fields': 'id,created_at', +} +headers = { + 'Authorization': 'Bearer {YOUR_API_TOKEN}', + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' +} + +response = requests.request('GET', url, headers=headers, params=params) +response.json()</code></pre> </div> + </div> + </div> + </div> + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-py-2"> + <div class="sl--ml-2"> + <div class="sl-h-sm sl-text-base sl-font-medium sl-px-1.5 sl-text-muted sl-rounded sl-border-transparent sl-border"> + <div class="sl-mb-2 sl-inline-block">Example response:</div> + <div class="sl-mb-2 sl-inline-block"> + <select + class="example-response-GETapi-v1-my-team-toggle sl-text-base" + aria-label="Response sample" + onchange="switchExampleResponse('GETapi-v1-my-team', event.target.value);"> + <option value="0">200</option> + </select></div> + </div> + </div> + </div> + <button type="button" + class="sl-button sl-h-sm sl-text-base sl-font-medium sl-px-1.5 hover:sl-bg-canvas-50 active:sl-bg-canvas-100 sl-text-muted hover:sl-text-body focus:sl-text-body sl-rounded sl-border-transparent sl-border disabled:sl-opacity-70"> + <div class="sl-mx-0"> + <svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="copy" + class="svg-inline--fa fa-copy fa-fw fa-sm sl-icon" role="img" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"> + <path fill="currentColor" + d="M384 96L384 0h-112c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48H464c26.51 0 48-21.49 48-48V128h-95.1C398.4 128 384 113.6 384 96zM416 0v96h96L416 0zM192 352V128h-144c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h192c26.51 0 48-21.49 48-48L288 416h-32C220.7 416 192 387.3 192 352z"></path> + </svg> + </div> + </button> + </div> + <div class="sl-panel__content-wrapper sl-bg-canvas-100 example-response-GETapi-v1-my-team example-response-GETapi-v1-my-team-0" + style=" " + > + <div class="sl-panel__content sl-p-0"> + <pre><code style="max-height: 300px;" + class="language-json sl-overflow-x-auto sl-overflow-y-auto">{"meta": {"responseCode": 200, "limit": 50, "offset": 0, "message": "", "cached": false, "availableRelations": []}, "data": {"current_page": 1, "data": {"id": 1, "name": "Team A", "created_at": "2024-08-16T06:54:28.000000Z", "updated_at": "2024-08-16T06:54:28.000000Z", "deleted_at": null}], "first_page_url": "https:\/\/vine.openfoodnetwork.org.au\/api\/v1\/my-team?page=1", "from": 1, "last_page": 1, "last_page_url": "https:\/\/vine.openfoodnetwork.org.au\/api\/v1\/my-team?page=1", "links": [{"url": null, "label": "&laquo; Previous", "active": false}, {"url": "https:\/\/vine.openfoodnetwork.org.au\/api\/v1\/my-team?page=1", "label": "1", "active": true}, {"url": null, "label": "Next &raquo;", "active": false}], "next_page_url": null, "path": "https:\/\/vine.openfoodnetwork.org.au\/api\/v1\/my-team", "per_page": 50, "prev_page_url": null, "to": 2, "total": 2}}</code></pre> + </div> + </div> + </div> + </div> + </div> +</div> + + <h2 id="app-endpoints-my-teams" + class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-3" + > + /my-teams + </h2> + <p>Teams you are a member of.</p> + <br> + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-relative"> + <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> + <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" + id="app-endpoints-GETapi-v1-my-teams"> + GET / + </h2> + </div> + </div> + + <div class="sl-relative"> + <div title="https://vine.openfoodnetwork.org.au/api/v1/my-teams" + class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" + > + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: green;" + > + GET + </div> + <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> + <div dir="rtl" + class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/my-teams</div> + </div> + + <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" + style="background-color: darkred" + >requires authentication + </div> + </div> + </div> + + <p>Retrieve your teams. Automatically filtered to your profile.</p> + </div> + <div class="sl-flex"> + <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> + <div class="sl-stack sl-stack--vertical sl-stack--10 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--8 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose"> + Headers + </h3> + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Authorization</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + Bearer {YOUR_API_TOKEN} + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + JWT eyJ0eXAiOiJKV... + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">Query Parameters</h3> + + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">cached</div> + <span class="sl-truncate sl-text-muted">boolean</span> + </div> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>Request the response to be cached. Default: <code>true</code>.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + 1 + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">page</div> + <span class="sl-truncate sl-text-muted">integer</span> + </div> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>The pagination page number.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + 1 + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">limit</div> + <span class="sl-truncate sl-text-muted">integer</span> + </div> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>The number of entries returned per pagination page.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + 50 + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">fields</div> + <span class="sl-truncate sl-text-muted">string</span> + </div> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>Comma-separated list of database fields to return within the object.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + id,created_at + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">orderBy</div> + <span class="sl-truncate sl-text-muted">comma-separated</span> + </div> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>Order the data by a given field. Comma-separated string.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + orderBy=id,desc + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">orderBy[]</div> + <span class="sl-truncate sl-text-muted">comma-separated</span> + </div> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>Compound <code>orderBy</code>. Order the data by a given field. Comma-separated string. Can not be used in conjunction as standard <code>orderBy</code>.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + orderBy[]=id,desc&orderBy[]=created_at,asc + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">where</div> + <span class="sl-truncate sl-text-muted">comma-separated</span> + </div> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>Filter the request on a single field. Key-Value or Key-Operator-Value comma-separated string.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + where=id,like,*550e* + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">where[]</div> + <span class="sl-truncate sl-text-muted">comma-separated</span> + </div> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>Compound <code>where</code>. Use when you need to filter on multiple <code>where</code>'s. Note only AND is possible; ORWHERE is not available.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + where[]=id,like,*550e*&where[]=created_at,>=,2024-01-01 + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + </div> + </div> + </div> + + <div data-testid="two-column-right" class="sl-relative sl-w-2/5 sl-ml-16" style="max-width: 500px;"> + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-h-lg"> + <div class="sl--ml-2"> + Example request: + <select class="example-request-lang-toggle sl-text-base" + aria-label="Request Sample Language" + onchange="switchExampleLanguage(event.target.value);"> + <option>bash</option> + <option>javascript</option> + <option>php</option> + <option>python</option> + </select> + </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-bash" + style=""> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-bash">curl --request GET \ + --get "https://vine.openfoodnetwork.org.au/api/v1/my-teams?cached=1&page=1&limit=50&fields=id%2Ccreated_at&orderBy=orderBy%3Did%2Cdesc&orderBy%5B%5D=orderBy%5B%5D%3Did%2Cdesc%26orderBy%5B%5D%3Dcreated_at%2Casc&where=where%3Did%2Clike%2C%2A550e%2A&where%5B%5D=where%5B%5D%3Did%2Clike%2C%2A550e%2A%26where%5B%5D%3Dcreated_at%2C%3E%3D%2C2024-01-01" \ + --header "Authorization: Bearer {YOUR_API_TOKEN}" \ + --header "Content-Type: application/json" \ + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..."</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-javascript" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-javascript">const url = new URL( + "https://vine.openfoodnetwork.org.au/api/v1/my-teams" +); + +const params = { + "cached": "1", + "page": "1", + "limit": "50", + "fields": "id,created_at", + "orderBy": "orderBy=id,desc", + "orderBy[]": "orderBy[]=id,desc&orderBy[]=created_at,asc", + "where": "where=id,like,*550e*", + "where[]": "where[]=id,like,*550e*&where[]=created_at,>=,2024-01-01", +}; +Object.keys(params) + .forEach(key => url.searchParams.append(key, params[key])); + +const headers = { + "Authorization": "Bearer {YOUR_API_TOKEN}", + "Content-Type": "application/json", + "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", +}; + +fetch(url, { + method: "GET", + headers, +}).then(response => response.json());</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-php" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-php">$client = new \GuzzleHttp\Client(); +$url = 'https://vine.openfoodnetwork.org.au/api/v1/my-teams'; +$response = $client->get( + $url, + [ + 'headers' => [ + 'Authorization' => 'Bearer {YOUR_API_TOKEN}', + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', + ], + 'query' => [ + 'cached' => '1', + 'page' => '1', + 'limit' => '50', + 'fields' => 'id,created_at', + 'orderBy' => 'orderBy=id,desc', + 'orderBy[]' => 'orderBy[]=id,desc&orderBy[]=created_at,asc', + 'where' => 'where=id,like,*550e*', + 'where[]' => 'where[]=id,like,*550e*&where[]=created_at,>=,2024-01-01', + ], + ] +); +$body = $response->getBody(); +print_r(json_decode((string) $body));</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-python" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-python">import requests +import json + +url = 'https://vine.openfoodnetwork.org.au/api/v1/my-teams' +params = { + 'cached': '1', + 'page': '1', + 'limit': '50', + 'fields': 'id,created_at', + 'orderBy': 'orderBy=id,desc', + 'orderBy[]': 'orderBy[]=id,desc&orderBy[]=created_at,asc', + 'where': 'where=id,like,*550e*', + 'where[]': 'where[]=id,like,*550e*&where[]=created_at,>=,2024-01-01', +} +headers = { + 'Authorization': 'Bearer {YOUR_API_TOKEN}', + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' +} + +response = requests.request('GET', url, headers=headers, params=params) +response.json()</code></pre> </div> + </div> + </div> + </div> + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-py-2"> + <div class="sl--ml-2"> + <div class="sl-h-sm sl-text-base sl-font-medium sl-px-1.5 sl-text-muted sl-rounded sl-border-transparent sl-border"> + <div class="sl-mb-2 sl-inline-block">Example response:</div> + <div class="sl-mb-2 sl-inline-block"> + <select + class="example-response-GETapi-v1-my-teams-toggle sl-text-base" + aria-label="Response sample" + onchange="switchExampleResponse('GETapi-v1-my-teams', event.target.value);"> + <option value="0">200</option> + </select></div> + </div> + </div> + </div> + <button type="button" + class="sl-button sl-h-sm sl-text-base sl-font-medium sl-px-1.5 hover:sl-bg-canvas-50 active:sl-bg-canvas-100 sl-text-muted hover:sl-text-body focus:sl-text-body sl-rounded sl-border-transparent sl-border disabled:sl-opacity-70"> + <div class="sl-mx-0"> + <svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="copy" + class="svg-inline--fa fa-copy fa-fw fa-sm sl-icon" role="img" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"> + <path fill="currentColor" + d="M384 96L384 0h-112c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48H464c26.51 0 48-21.49 48-48V128h-95.1C398.4 128 384 113.6 384 96zM416 0v96h96L416 0zM192 352V128h-144c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h192c26.51 0 48-21.49 48-48L288 416h-32C220.7 416 192 387.3 192 352z"></path> + </svg> + </div> + </button> + </div> + <div class="sl-panel__content-wrapper sl-bg-canvas-100 example-response-GETapi-v1-my-teams example-response-GETapi-v1-my-teams-0" + style=" " + > + <div class="sl-panel__content sl-p-0"> + <pre><code style="max-height: 300px;" + class="language-json sl-overflow-x-auto sl-overflow-y-auto">{ + "meta": { + "responseCode": 200, + "limit": 50, + "offset": 0, + "message": "", + "cached": false, + "availableRelations": [] + }, + "data": { + "current_page": 1, + "data": [ + { + "id": 1, + "name": "Team A", + "created_at": "2024-08-16T06:54:28.000000Z", + "updated_at": "2024-08-16T06:54:28.000000Z", + "deleted_at": null + }, + { + "id": 2, + "name": "Team B", + "created_at": "2024-08-16T06:54:29.000000Z", + "updated_at": "2024-08-16T06:54:29.000000Z", + "deleted_at": null + } + ], + "first_page_url": "https://vine.openfoodnetwork.org.au/api/v1/my-teams?page=1", + "from": 1, + "last_page": 1, + "last_page_url": "https://vine.openfoodnetwork.org.au/api/v1/my-teams?page=1", + "links": [ + { + "url": null, + "label": "&laquo; Previous", + "active": false + }, + { + "url": "https://vine.openfoodnetwork.org.au/api/v1/my-teams?page=1", + "label": "1", + "active": true + }, + { + "url": null, + "label": "Next &raquo;", + "active": false + } + ], + "next_page_url": null, + "path": "https://vine.openfoodnetwork.org.au/api/v1/my-teams", + "per_page": 50, + "prev_page_url": null, + "to": 2, + "total": 2 + } +}</code></pre> + </div> + </div> + </div> + </div> + </div> +</div> + + <h2 id="app-endpoints-my-team-audit-items" + class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-3" + > + /my-team-audit-items + </h2> + <p>Retrieve your team audit trail.</p> + <br> + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-relative"> + <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> + <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" + id="app-endpoints-GETapi-v1-my-team-audit-items"> + GET / + </h2> + </div> + </div> + + <div class="sl-relative"> + <div title="https://vine.openfoodnetwork.org.au/api/v1/my-team-audit-items" + class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" + > + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: green;" + > + GET + </div> + <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> + <div dir="rtl" + class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/my-team-audit-items</div> + </div> + + <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" + style="background-color: darkred" + >requires authentication + </div> + </div> + </div> + + <p>Retrieve your audit items. Automatically filtered to your current team.</p> + </div> + <div class="sl-flex"> + <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> + <div class="sl-stack sl-stack--vertical sl-stack--10 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--8 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose"> + Headers + </h3> + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Authorization</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + Bearer {YOUR_API_TOKEN} + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + JWT eyJ0eXAiOiJKV... + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">Query Parameters</h3> + + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">cached</div> + <span class="sl-truncate sl-text-muted">boolean</span> + </div> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>Request the response to be cached. Default: <code>true</code>.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + 1 + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">fields</div> + <span class="sl-truncate sl-text-muted">string</span> + </div> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>Comma-separated list of database fields to return within the object.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + id,created_at + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + </div> + </div> + </div> + + <div data-testid="two-column-right" class="sl-relative sl-w-2/5 sl-ml-16" style="max-width: 500px;"> + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-h-lg"> + <div class="sl--ml-2"> + Example request: + <select class="example-request-lang-toggle sl-text-base" + aria-label="Request Sample Language" + onchange="switchExampleLanguage(event.target.value);"> + <option>bash</option> + <option>javascript</option> + <option>php</option> + <option>python</option> + </select> + </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-bash" + style=""> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-bash">curl --request GET \ + --get "https://vine.openfoodnetwork.org.au/api/v1/my-team-audit-items?cached=1&fields=id%2Ccreated_at" \ + --header "Authorization: Bearer {YOUR_API_TOKEN}" \ + --header "Content-Type: application/json" \ + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..."</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-javascript" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-javascript">const url = new URL( + "https://vine.openfoodnetwork.org.au/api/v1/my-team-audit-items" +); + +const params = { + "cached": "1", + "fields": "id,created_at", +}; +Object.keys(params) + .forEach(key => url.searchParams.append(key, params[key])); + +const headers = { + "Authorization": "Bearer {YOUR_API_TOKEN}", + "Content-Type": "application/json", + "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", +}; + +fetch(url, { + method: "GET", + headers, +}).then(response => response.json());</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-php" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-php">$client = new \GuzzleHttp\Client(); +$url = 'https://vine.openfoodnetwork.org.au/api/v1/my-team-audit-items'; +$response = $client->get( + $url, + [ + 'headers' => [ + 'Authorization' => 'Bearer {YOUR_API_TOKEN}', + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', + ], + 'query' => [ + 'cached' => '1', + 'fields' => 'id,created_at', + ], + ] +); +$body = $response->getBody(); +print_r(json_decode((string) $body));</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-python" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-python">import requests +import json + +url = 'https://vine.openfoodnetwork.org.au/api/v1/my-team-audit-items' +params = { + 'cached': '1', + 'fields': 'id,created_at', +} +headers = { + 'Authorization': 'Bearer {YOUR_API_TOKEN}', + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' +} + +response = requests.request('GET', url, headers=headers, params=params) +response.json()</code></pre> </div> + </div> + </div> + </div> + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-py-2"> + <div class="sl--ml-2"> + <div class="sl-h-sm sl-text-base sl-font-medium sl-px-1.5 sl-text-muted sl-rounded sl-border-transparent sl-border"> + <div class="sl-mb-2 sl-inline-block">Example response:</div> + <div class="sl-mb-2 sl-inline-block"> + <select + class="example-response-GETapi-v1-my-team-audit-items-toggle sl-text-base" + aria-label="Response sample" + onchange="switchExampleResponse('GETapi-v1-my-team-audit-items', event.target.value);"> + <option value="0">200</option> + </select></div> + </div> + </div> + </div> + <button type="button" + class="sl-button sl-h-sm sl-text-base sl-font-medium sl-px-1.5 hover:sl-bg-canvas-50 active:sl-bg-canvas-100 sl-text-muted hover:sl-text-body focus:sl-text-body sl-rounded sl-border-transparent sl-border disabled:sl-opacity-70"> + <div class="sl-mx-0"> + <svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="copy" + class="svg-inline--fa fa-copy fa-fw fa-sm sl-icon" role="img" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"> + <path fill="currentColor" + d="M384 96L384 0h-112c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48H464c26.51 0 48-21.49 48-48V128h-95.1C398.4 128 384 113.6 384 96zM416 0v96h96L416 0zM192 352V128h-144c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h192c26.51 0 48-21.49 48-48L288 416h-32C220.7 416 192 387.3 192 352z"></path> + </svg> + </div> + </button> + </div> + <div class="sl-panel__content-wrapper sl-bg-canvas-100 example-response-GETapi-v1-my-team-audit-items example-response-GETapi-v1-my-team-audit-items-0" + style=" " + > + <div class="sl-panel__content sl-p-0"> + <pre><code style="max-height: 300px;" + class="language-json sl-overflow-x-auto sl-overflow-y-auto">{"meta": {"responseCode": 200, "limit": 50, "offset": 0, "message": "", "cached": false, "availableRelations": []}, "data": {"current_page": 1, "data": {"id": 1, "name": "Team A", "created_at": "2024-08-16T06:54:28.000000Z", "updated_at": "2024-08-16T06:54:28.000000Z", "deleted_at": null}], "first_page_url": "https:\/\/vine.openfoodnetwork.org.au\/api\/v1\/my-team-audit-items?page=1", "from": 1, "last_page": 1, "last_page_url": "https:\/\/vine.openfoodnetwork.org.au\/api\/v1\/my-team-audit-items?page=1", "links": [{"url": null, "label": "&laquo; Previous", "active": false}, {"url": "https:\/\/vine.openfoodnetwork.org.au\/api\/v1\/my-team-audit-items?page=1", "label": "1", "active": true}, {"url": null, "label": "Next &raquo;", "active": false}], "next_page_url": null, "path": "https:\/\/vine.openfoodnetwork.org.au\/api\/v1\/my-team-audit-items", "per_page": 50, "prev_page_url": null, "to": 2, "total": 2}}</code></pre> + </div> + </div> + </div> + </div> + </div> +</div> + + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-relative"> + <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> + <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" + id="app-endpoints-GETapi-v1-my-team-audit-items--id-"> + GET /{id} + </h2> + </div> + </div> + + <div class="sl-relative"> + <div title="https://vine.openfoodnetwork.org.au/api/v1/my-team-audit-items/{id}" + class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" + > + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: green;" + > + GET + </div> + <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> + <div dir="rtl" + class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/my-team-audit-items/{id}</div> + </div> + + <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" + style="background-color: darkred" + >requires authentication + </div> + </div> + </div> + + <p>Retrieve a single audit item for your team.</p> + </div> + <div class="sl-flex"> + <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> + <div class="sl-stack sl-stack--vertical sl-stack--10 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--8 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose"> + Headers + </h3> + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Authorization</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + Bearer {YOUR_API_TOKEN} + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + JWT eyJ0eXAiOiJKV... + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">URL Parameters</h3> + + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">id</div> + <span class="sl-truncate sl-text-muted">integer</span> + </div> + <div class="sl-flex-1 sl-h-px sl-mx-3"></div> + <span class="sl-ml-2 sl-text-warning">required</span> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>ID.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + 1234 + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">Query Parameters</h3> + + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">cached</div> + <span class="sl-truncate sl-text-muted">boolean</span> + </div> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>Request the response to be cached. Default: <code>true</code>.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + 1 + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">fields</div> + <span class="sl-truncate sl-text-muted">string</span> + </div> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>Comma-separated list of database fields to return within the object.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + id,created_at + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + </div> + </div> + </div> + + <div data-testid="two-column-right" class="sl-relative sl-w-2/5 sl-ml-16" style="max-width: 500px;"> + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-h-lg"> + <div class="sl--ml-2"> + Example request: + <select class="example-request-lang-toggle sl-text-base" + aria-label="Request Sample Language" + onchange="switchExampleLanguage(event.target.value);"> + <option>bash</option> + <option>javascript</option> + <option>php</option> + <option>python</option> + </select> + </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-bash" + style=""> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-bash">curl --request GET \ + --get "https://vine.openfoodnetwork.org.au/api/v1/my-team-audit-items/1234?cached=1&fields=id%2Ccreated_at" \ + --header "Authorization: Bearer {YOUR_API_TOKEN}" \ + --header "Content-Type: application/json" \ + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..."</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-javascript" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-javascript">const url = new URL( + "https://vine.openfoodnetwork.org.au/api/v1/my-team-audit-items/1234" +); + +const params = { + "cached": "1", + "fields": "id,created_at", +}; +Object.keys(params) + .forEach(key => url.searchParams.append(key, params[key])); + +const headers = { + "Authorization": "Bearer {YOUR_API_TOKEN}", + "Content-Type": "application/json", + "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", +}; + +fetch(url, { + method: "GET", + headers, +}).then(response => response.json());</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-php" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-php">$client = new \GuzzleHttp\Client(); +$url = 'https://vine.openfoodnetwork.org.au/api/v1/my-team-audit-items/1234'; +$response = $client->get( + $url, + [ + 'headers' => [ + 'Authorization' => 'Bearer {YOUR_API_TOKEN}', + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', + ], + 'query' => [ + 'cached' => '1', + 'fields' => 'id,created_at', + ], + ] +); +$body = $response->getBody(); +print_r(json_decode((string) $body));</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-python" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-python">import requests +import json + +url = 'https://vine.openfoodnetwork.org.au/api/v1/my-team-audit-items/1234' +params = { + 'cached': '1', + 'fields': 'id,created_at', +} +headers = { + 'Authorization': 'Bearer {YOUR_API_TOKEN}', + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' +} + +response = requests.request('GET', url, headers=headers, params=params) +response.json()</code></pre> </div> + </div> + </div> + </div> + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-py-2"> + <div class="sl--ml-2"> + <div class="sl-h-sm sl-text-base sl-font-medium sl-px-1.5 sl-text-muted sl-rounded sl-border-transparent sl-border"> + <div class="sl-mb-2 sl-inline-block">Example response:</div> + <div class="sl-mb-2 sl-inline-block"> + <select + class="example-response-GETapi-v1-my-team-audit-items--id--toggle sl-text-base" + aria-label="Response sample" + onchange="switchExampleResponse('GETapi-v1-my-team-audit-items--id-', event.target.value);"> + <option value="0">401</option> + </select></div> + </div> + </div> + </div> + <button type="button" + class="sl-button sl-h-sm sl-text-base sl-font-medium sl-px-1.5 hover:sl-bg-canvas-50 active:sl-bg-canvas-100 sl-text-muted hover:sl-text-body focus:sl-text-body sl-rounded sl-border-transparent sl-border disabled:sl-opacity-70"> + <div class="sl-mx-0"> + <svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="copy" + class="svg-inline--fa fa-copy fa-fw fa-sm sl-icon" role="img" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"> + <path fill="currentColor" + d="M384 96L384 0h-112c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48H464c26.51 0 48-21.49 48-48V128h-95.1C398.4 128 384 113.6 384 96zM416 0v96h96L416 0zM192 352V128h-144c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h192c26.51 0 48-21.49 48-48L288 416h-32C220.7 416 192 387.3 192 352z"></path> + </svg> + </div> + </button> + </div> + <div class="sl-panel__content-wrapper sl-bg-canvas-100 example-response-GETapi-v1-my-team-audit-items--id- example-response-GETapi-v1-my-team-audit-items--id--0" + style=" " + > + <div class="sl-panel__content sl-p-0"> <details class="sl-pl-2"> + <summary style="cursor: pointer; list-style: none;"> + <small> + <span class="expansion-chevrons"> + + <svg aria-hidden="true" focusable="false" data-prefix="fas" + data-icon="chevron-right" + class="svg-inline--fa fa-chevron-right fa-fw sl-icon sl-text-muted" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"> + <path fill="currentColor" + d="M96 480c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L242.8 256L73.38 86.63c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l192 192c12.5 12.5 12.5 32.75 0 45.25l-192 192C112.4 476.9 104.2 480 96 480z"></path> + </svg> + </span> + Headers + </small> + </summary> + <pre><code class="language-http"> cache-control + : no-cache, private + content-type + : application/json + access-control-allow-origin + : * + </code></pre> + </details> + + <pre><code style="max-height: 300px;" + class="language-json sl-overflow-x-auto sl-overflow-y-auto">{ + "message": "Unauthenticated." +}</code></pre> + </div> + </div> + </div> + </div> + </div> +</div> + + <h2 id="app-endpoints-my-team-vouchers" + class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-3" + > + /my-team-vouchers + </h2> + <p>Manage your team's vouchers. Returns vouchers generated by your team, and allocated to your team.</p> + <br> + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-relative"> + <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> + <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" + id="app-endpoints-GETapi-v1-my-team-vouchers"> + GET / + </h2> + </div> + </div> + + <div class="sl-relative"> + <div title="https://vine.openfoodnetwork.org.au/api/v1/my-team-vouchers" + class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" + > + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: green;" + > + GET + </div> + <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> + <div dir="rtl" + class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/my-team-vouchers</div> + </div> + + <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" + style="background-color: darkred" + >requires authentication + </div> + </div> + </div> + + <p>Retrieve vouchers. Automatically filtered to your current team.</p> + </div> + <div class="sl-flex"> + <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> + <div class="sl-stack sl-stack--vertical sl-stack--10 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--8 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose"> + Headers + </h3> + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Authorization</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + Bearer {YOUR_API_TOKEN} + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + JWT eyJ0eXAiOiJKV... + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">Query Parameters</h3> + + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">cached</div> + <span class="sl-truncate sl-text-muted">boolean</span> + </div> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>Request the response to be cached. Default: <code>true</code>.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + 1 + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">page</div> + <span class="sl-truncate sl-text-muted">integer</span> + </div> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>The pagination page number.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + 1 + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">limit</div> + <span class="sl-truncate sl-text-muted">integer</span> + </div> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>The number of entries returned per pagination page.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + 50 + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">fields</div> + <span class="sl-truncate sl-text-muted">string</span> + </div> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>Comma-separated list of database fields to return within the object.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + id,created_at + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">orderBy</div> + <span class="sl-truncate sl-text-muted">comma-separated</span> + </div> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>Order the data by a given field. Comma-separated string.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + orderBy=id,desc + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">orderBy[]</div> + <span class="sl-truncate sl-text-muted">comma-separated</span> + </div> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>Compound <code>orderBy</code>. Order the data by a given field. Comma-separated string. Can not be used in conjunction as standard <code>orderBy</code>.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + orderBy[]=id,desc&orderBy[]=created_at,asc + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">where</div> + <span class="sl-truncate sl-text-muted">comma-separated</span> + </div> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>Filter the request on a single field. Key-Value or Key-Operator-Value comma-separated string.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + where=id,like,*550e* + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">where[]</div> + <span class="sl-truncate sl-text-muted">comma-separated</span> + </div> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>Compound <code>where</code>. Use when you need to filter on multiple <code>where</code>'s. Note only AND is possible; ORWHERE is not available.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + where[]=id,like,*550e*&where[]=created_at,>=,2024-01-01 + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + </div> + </div> + </div> + + <div data-testid="two-column-right" class="sl-relative sl-w-2/5 sl-ml-16" style="max-width: 500px;"> + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-h-lg"> + <div class="sl--ml-2"> + Example request: + <select class="example-request-lang-toggle sl-text-base" + aria-label="Request Sample Language" + onchange="switchExampleLanguage(event.target.value);"> + <option>bash</option> + <option>javascript</option> + <option>php</option> + <option>python</option> + </select> + </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-bash" + style=""> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-bash">curl --request GET \ + --get "https://vine.openfoodnetwork.org.au/api/v1/my-team-vouchers?cached=1&page=1&limit=50&fields=id%2Ccreated_at&orderBy=orderBy%3Did%2Cdesc&orderBy%5B%5D=orderBy%5B%5D%3Did%2Cdesc%26orderBy%5B%5D%3Dcreated_at%2Casc&where=where%3Did%2Clike%2C%2A550e%2A&where%5B%5D=where%5B%5D%3Did%2Clike%2C%2A550e%2A%26where%5B%5D%3Dcreated_at%2C%3E%3D%2C2024-01-01" \ + --header "Authorization: Bearer {YOUR_API_TOKEN}" \ + --header "Content-Type: application/json" \ + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..."</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-javascript" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-javascript">const url = new URL( + "https://vine.openfoodnetwork.org.au/api/v1/my-team-vouchers" +); + +const params = { + "cached": "1", + "page": "1", + "limit": "50", + "fields": "id,created_at", + "orderBy": "orderBy=id,desc", + "orderBy[]": "orderBy[]=id,desc&orderBy[]=created_at,asc", + "where": "where=id,like,*550e*", + "where[]": "where[]=id,like,*550e*&where[]=created_at,>=,2024-01-01", +}; +Object.keys(params) + .forEach(key => url.searchParams.append(key, params[key])); + +const headers = { + "Authorization": "Bearer {YOUR_API_TOKEN}", + "Content-Type": "application/json", + "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", +}; + +fetch(url, { + method: "GET", + headers, +}).then(response => response.json());</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-php" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-php">$client = new \GuzzleHttp\Client(); +$url = 'https://vine.openfoodnetwork.org.au/api/v1/my-team-vouchers'; +$response = $client->get( + $url, + [ + 'headers' => [ + 'Authorization' => 'Bearer {YOUR_API_TOKEN}', + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', + ], + 'query' => [ + 'cached' => '1', + 'page' => '1', + 'limit' => '50', + 'fields' => 'id,created_at', + 'orderBy' => 'orderBy=id,desc', + 'orderBy[]' => 'orderBy[]=id,desc&orderBy[]=created_at,asc', + 'where' => 'where=id,like,*550e*', + 'where[]' => 'where[]=id,like,*550e*&where[]=created_at,>=,2024-01-01', + ], + ] +); +$body = $response->getBody(); +print_r(json_decode((string) $body));</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-python" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-python">import requests +import json + +url = 'https://vine.openfoodnetwork.org.au/api/v1/my-team-vouchers' +params = { + 'cached': '1', + 'page': '1', + 'limit': '50', + 'fields': 'id,created_at', + 'orderBy': 'orderBy=id,desc', + 'orderBy[]': 'orderBy[]=id,desc&orderBy[]=created_at,asc', + 'where': 'where=id,like,*550e*', + 'where[]': 'where[]=id,like,*550e*&where[]=created_at,>=,2024-01-01', +} +headers = { + 'Authorization': 'Bearer {YOUR_API_TOKEN}', + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' +} + +response = requests.request('GET', url, headers=headers, params=params) +response.json()</code></pre> </div> + </div> + </div> + </div> + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-py-2"> + <div class="sl--ml-2"> + <div class="sl-h-sm sl-text-base sl-font-medium sl-px-1.5 sl-text-muted sl-rounded sl-border-transparent sl-border"> + <div class="sl-mb-2 sl-inline-block">Example response:</div> + <div class="sl-mb-2 sl-inline-block"> + <select + class="example-response-GETapi-v1-my-team-vouchers-toggle sl-text-base" + aria-label="Response sample" + onchange="switchExampleResponse('GETapi-v1-my-team-vouchers', event.target.value);"> + <option value="0">200</option> + </select></div> + </div> + </div> + </div> + <button type="button" + class="sl-button sl-h-sm sl-text-base sl-font-medium sl-px-1.5 hover:sl-bg-canvas-50 active:sl-bg-canvas-100 sl-text-muted hover:sl-text-body focus:sl-text-body sl-rounded sl-border-transparent sl-border disabled:sl-opacity-70"> + <div class="sl-mx-0"> + <svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="copy" + class="svg-inline--fa fa-copy fa-fw fa-sm sl-icon" role="img" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"> + <path fill="currentColor" + d="M384 96L384 0h-112c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48H464c26.51 0 48-21.49 48-48V128h-95.1C398.4 128 384 113.6 384 96zM416 0v96h96L416 0zM192 352V128h-144c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h192c26.51 0 48-21.49 48-48L288 416h-32C220.7 416 192 387.3 192 352z"></path> + </svg> + </div> + </button> + </div> + <div class="sl-panel__content-wrapper sl-bg-canvas-100 example-response-GETapi-v1-my-team-vouchers example-response-GETapi-v1-my-team-vouchers-0" + style=" " + > + <div class="sl-panel__content sl-p-0"> + <pre><code style="max-height: 300px;" + class="language-json sl-overflow-x-auto sl-overflow-y-auto">{ + "meta": { + "responseCode": 200, + "limit": 50, + "offset": 0, + "message": "", + "cached": false, + "availableRelations": [] + }, + "data": { + "current_page": 1, + "data": [ + { + "id": "550e8400-e29b-41d4-a716-446655440000", + "created_at": "2024-01-01 00:00:00" + } + ], + "first_page_url": "https://open-food-network-vouchers.test/api/v1/admin/system-statistics?page=1", + "from": null, + "last_page": 1, + "last_page_url": "https://open-food-network-vouchers.test/api/v1/admin/system-statistics?page=1", + "links": [ + { + "url": null, + "label": "&laquo; Previous", + "active": false + }, + { + "url": "https://open-food-network-vouchers.test/api/v1/admin/system-statistics?page=1", + "label": "1", + "active": true + }, + { + "url": null, + "label": "Next &raquo;", + "active": false + } + ], + "next_page_url": null, + "path": "https://open-food-network-vouchers.test/api/v1/admin/system-statistics", + "per_page": 1, + "prev_page_url": null, + "to": null, + "total": 0 + } +}</code></pre> + </div> + </div> + </div> + </div> + </div> +</div> + + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-relative"> + <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> + <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" + id="app-endpoints-GETapi-v1-my-team-vouchers--id-"> + GET /{id} + </h2> + </div> + </div> + + <div class="sl-relative"> + <div title="https://vine.openfoodnetwork.org.au/api/v1/my-team-vouchers/{id}" + class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" + > + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: green;" + > + GET + </div> + <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> + <div dir="rtl" + class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/my-team-vouchers/{id}</div> + </div> + + <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" + style="background-color: darkred" + >requires authentication + </div> + </div> + </div> + + <p>Retrieve a single voucher.</p> + </div> + <div class="sl-flex"> + <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> + <div class="sl-stack sl-stack--vertical sl-stack--10 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--8 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose"> + Headers + </h3> + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Authorization</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + Bearer {YOUR_API_TOKEN} + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + JWT eyJ0eXAiOiJKV... + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">URL Parameters</h3> + + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">id</div> + <span class="sl-truncate sl-text-muted">uuid</span> + </div> + <div class="sl-flex-1 sl-h-px sl-mx-3"></div> + <span class="sl-ml-2 sl-text-warning">required</span> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>Voucher ID.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + 550e8400-e29b-41d4-a716-446655440000 + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">Query Parameters</h3> + + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">cached</div> + <span class="sl-truncate sl-text-muted">boolean</span> + </div> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>Request the response to be cached. Default: <code>true</code>.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + 1 + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">fields</div> + <span class="sl-truncate sl-text-muted">string</span> + </div> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>Comma-separated list of database fields to return within the object.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + id,created_at + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + </div> + </div> + </div> + + <div data-testid="two-column-right" class="sl-relative sl-w-2/5 sl-ml-16" style="max-width: 500px;"> + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-h-lg"> + <div class="sl--ml-2"> + Example request: + <select class="example-request-lang-toggle sl-text-base" + aria-label="Request Sample Language" + onchange="switchExampleLanguage(event.target.value);"> + <option>bash</option> + <option>javascript</option> + <option>php</option> + <option>python</option> + </select> + </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-bash" + style=""> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-bash">curl --request GET \ + --get "https://vine.openfoodnetwork.org.au/api/v1/my-team-vouchers/550e8400-e29b-41d4-a716-446655440000?cached=1&fields=id%2Ccreated_at" \ + --header "Authorization: Bearer {YOUR_API_TOKEN}" \ + --header "Content-Type: application/json" \ + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..."</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-javascript" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-javascript">const url = new URL( + "https://vine.openfoodnetwork.org.au/api/v1/my-team-vouchers/550e8400-e29b-41d4-a716-446655440000" +); + +const params = { + "cached": "1", + "fields": "id,created_at", +}; +Object.keys(params) + .forEach(key => url.searchParams.append(key, params[key])); + +const headers = { + "Authorization": "Bearer {YOUR_API_TOKEN}", + "Content-Type": "application/json", + "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", +}; + +fetch(url, { + method: "GET", + headers, +}).then(response => response.json());</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-php" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-php">$client = new \GuzzleHttp\Client(); +$url = 'https://vine.openfoodnetwork.org.au/api/v1/my-team-vouchers/550e8400-e29b-41d4-a716-446655440000'; +$response = $client->get( + $url, + [ + 'headers' => [ + 'Authorization' => 'Bearer {YOUR_API_TOKEN}', + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', + ], + 'query' => [ + 'cached' => '1', + 'fields' => 'id,created_at', + ], + ] +); +$body = $response->getBody(); +print_r(json_decode((string) $body));</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-python" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-python">import requests +import json + +url = 'https://vine.openfoodnetwork.org.au/api/v1/my-team-vouchers/550e8400-e29b-41d4-a716-446655440000' +params = { + 'cached': '1', + 'fields': 'id,created_at', +} +headers = { + 'Authorization': 'Bearer {YOUR_API_TOKEN}', + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' +} + +response = requests.request('GET', url, headers=headers, params=params) +response.json()</code></pre> </div> + </div> + </div> + </div> + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-py-2"> + <div class="sl--ml-2"> + <div class="sl-h-sm sl-text-base sl-font-medium sl-px-1.5 sl-text-muted sl-rounded sl-border-transparent sl-border"> + <div class="sl-mb-2 sl-inline-block">Example response:</div> + <div class="sl-mb-2 sl-inline-block"> + <select + class="example-response-GETapi-v1-my-team-vouchers--id--toggle sl-text-base" + aria-label="Response sample" + onchange="switchExampleResponse('GETapi-v1-my-team-vouchers--id-', event.target.value);"> + <option value="0">200</option> + </select></div> + </div> + </div> + </div> + <button type="button" + class="sl-button sl-h-sm sl-text-base sl-font-medium sl-px-1.5 hover:sl-bg-canvas-50 active:sl-bg-canvas-100 sl-text-muted hover:sl-text-body focus:sl-text-body sl-rounded sl-border-transparent sl-border disabled:sl-opacity-70"> + <div class="sl-mx-0"> + <svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="copy" + class="svg-inline--fa fa-copy fa-fw fa-sm sl-icon" role="img" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"> + <path fill="currentColor" + d="M384 96L384 0h-112c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48H464c26.51 0 48-21.49 48-48V128h-95.1C398.4 128 384 113.6 384 96zM416 0v96h96L416 0zM192 352V128h-144c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h192c26.51 0 48-21.49 48-48L288 416h-32C220.7 416 192 387.3 192 352z"></path> + </svg> + </div> + </button> + </div> + <div class="sl-panel__content-wrapper sl-bg-canvas-100 example-response-GETapi-v1-my-team-vouchers--id- example-response-GETapi-v1-my-team-vouchers--id--0" + style=" " + > + <div class="sl-panel__content sl-p-0"> + <pre><code style="max-height: 300px;" + class="language-json sl-overflow-x-auto sl-overflow-y-auto">{ + "meta": { + "responseCode": 200, + "limit": 50, + "offset": 0, + "message": "", + "cached": true, + "cached_at": "2024-08-13 08:58:19", + "availableRelations": [] + }, + "data": { + "id": 1234, + "created_at": "2024-01-01 00:00:00" + } +}</code></pre> + </div> + </div> + </div> + </div> + </div> +</div> + + <h2 id="app-endpoints-system-statistics" + class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-3" + > + /system-statistics + </h2> + <p>Vine platform statistics.</p> + <br> + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-relative"> + <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> + <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" + id="app-endpoints-GETapi-v1-system-statistics"> + GET / + </h2> + </div> + </div> + + <div class="sl-relative"> + <div title="https://vine.openfoodnetwork.org.au/api/v1/system-statistics" + class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" + > + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: green;" + > + GET + </div> + <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> + <div dir="rtl" + class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/system-statistics</div> + </div> + + <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" + style="background-color: darkred" + >requires authentication + </div> + </div> + </div> + + <p>Retrieve system statistics.</p> + </div> + <div class="sl-flex"> + <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> + <div class="sl-stack sl-stack--vertical sl-stack--10 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--8 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose"> + Headers + </h3> + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Authorization</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + Bearer {YOUR_API_TOKEN} + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + JWT eyJ0eXAiOiJKV... + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">Query Parameters</h3> + + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">cached</div> + <span class="sl-truncate sl-text-muted">boolean</span> + </div> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>Request the response to be cached. Default: <code>true</code>.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + 1 + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">page</div> + <span class="sl-truncate sl-text-muted">integer</span> + </div> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>The pagination page number.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + 1 + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">limit</div> + <span class="sl-truncate sl-text-muted">integer</span> + </div> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>The number of entries returned per pagination page.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + 50 + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">fields</div> + <span class="sl-truncate sl-text-muted">string</span> + </div> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>Comma-separated list of database fields to return within the object.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + id,sum_voucher_value_total + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">orderBy</div> + <span class="sl-truncate sl-text-muted">comma-separated</span> + </div> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>Order the data by a given field. Comma-separated string.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + orderBy=sum_voucher_value_total,desc + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">orderBy[]</div> + <span class="sl-truncate sl-text-muted">comma-separated</span> + </div> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>Compound <code>orderBy</code>. Order the data by a given field. Comma-separated string. Can not be used in conjunction as standard <code>orderBy</code>.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + orderBy[]=id,desc&orderBy[]=created_at,asc + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">where</div> + <span class="sl-truncate sl-text-muted">comma-separated</span> + </div> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>Filter the request on a single field. Key-Value or Key-Operator-Value comma-separated string.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + where=id,>,123 + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">where[]</div> + <span class="sl-truncate sl-text-muted">comma-separated</span> + </div> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>Compound <code>where</code>. Use when you need to filter on multiple <code>where</code>'s. Note only AND is possible; ORWHERE is not available.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + where[]=id,like,*550e*&where[]=created_at,>=,2024-01-01 + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + </div> + </div> + </div> + + <div data-testid="two-column-right" class="sl-relative sl-w-2/5 sl-ml-16" style="max-width: 500px;"> + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-h-lg"> + <div class="sl--ml-2"> + Example request: + <select class="example-request-lang-toggle sl-text-base" + aria-label="Request Sample Language" + onchange="switchExampleLanguage(event.target.value);"> + <option>bash</option> + <option>javascript</option> + <option>php</option> + <option>python</option> + </select> + </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-bash" + style=""> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-bash">curl --request GET \ + --get "https://vine.openfoodnetwork.org.au/api/v1/system-statistics?cached=1&page=1&limit=50&fields=id%2Csum_voucher_value_total&orderBy=orderBy%3Dsum_voucher_value_total%2Cdesc&orderBy%5B%5D=orderBy%5B%5D%3Did%2Cdesc%26orderBy%5B%5D%3Dcreated_at%2Casc&where=where%3Did%2C%3E%2C123&where%5B%5D=where%5B%5D%3Did%2Clike%2C%2A550e%2A%26where%5B%5D%3Dcreated_at%2C%3E%3D%2C2024-01-01" \ + --header "Authorization: Bearer {YOUR_API_TOKEN}" \ + --header "Content-Type: application/json" \ + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..."</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-javascript" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-javascript">const url = new URL( + "https://vine.openfoodnetwork.org.au/api/v1/system-statistics" +); + +const params = { + "cached": "1", + "page": "1", + "limit": "50", + "fields": "id,sum_voucher_value_total", + "orderBy": "orderBy=sum_voucher_value_total,desc", + "orderBy[]": "orderBy[]=id,desc&orderBy[]=created_at,asc", + "where": "where=id,>,123", + "where[]": "where[]=id,like,*550e*&where[]=created_at,>=,2024-01-01", +}; +Object.keys(params) + .forEach(key => url.searchParams.append(key, params[key])); + +const headers = { + "Authorization": "Bearer {YOUR_API_TOKEN}", + "Content-Type": "application/json", + "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", +}; + +fetch(url, { + method: "GET", + headers, +}).then(response => response.json());</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-php" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-php">$client = new \GuzzleHttp\Client(); +$url = 'https://vine.openfoodnetwork.org.au/api/v1/system-statistics'; +$response = $client->get( + $url, + [ + 'headers' => [ + 'Authorization' => 'Bearer {YOUR_API_TOKEN}', + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', + ], + 'query' => [ + 'cached' => '1', + 'page' => '1', + 'limit' => '50', + 'fields' => 'id,sum_voucher_value_total', + 'orderBy' => 'orderBy=sum_voucher_value_total,desc', + 'orderBy[]' => 'orderBy[]=id,desc&orderBy[]=created_at,asc', + 'where' => 'where=id,>,123', + 'where[]' => 'where[]=id,like,*550e*&where[]=created_at,>=,2024-01-01', + ], + ] +); +$body = $response->getBody(); +print_r(json_decode((string) $body));</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-python" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-python">import requests +import json + +url = 'https://vine.openfoodnetwork.org.au/api/v1/system-statistics' +params = { + 'cached': '1', + 'page': '1', + 'limit': '50', + 'fields': 'id,sum_voucher_value_total', + 'orderBy': 'orderBy=sum_voucher_value_total,desc', + 'orderBy[]': 'orderBy[]=id,desc&orderBy[]=created_at,asc', + 'where': 'where=id,>,123', + 'where[]': 'where[]=id,like,*550e*&where[]=created_at,>=,2024-01-01', +} +headers = { + 'Authorization': 'Bearer {YOUR_API_TOKEN}', + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' +} + +response = requests.request('GET', url, headers=headers, params=params) +response.json()</code></pre> </div> + </div> + </div> + </div> + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-py-2"> + <div class="sl--ml-2"> + <div class="sl-h-sm sl-text-base sl-font-medium sl-px-1.5 sl-text-muted sl-rounded sl-border-transparent sl-border"> + <div class="sl-mb-2 sl-inline-block">Example response:</div> + <div class="sl-mb-2 sl-inline-block"> + <select + class="example-response-GETapi-v1-system-statistics-toggle sl-text-base" + aria-label="Response sample" + onchange="switchExampleResponse('GETapi-v1-system-statistics', event.target.value);"> + <option value="0">200</option> + </select></div> + </div> + </div> + </div> + <button type="button" + class="sl-button sl-h-sm sl-text-base sl-font-medium sl-px-1.5 hover:sl-bg-canvas-50 active:sl-bg-canvas-100 sl-text-muted hover:sl-text-body focus:sl-text-body sl-rounded sl-border-transparent sl-border disabled:sl-opacity-70"> + <div class="sl-mx-0"> + <svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="copy" + class="svg-inline--fa fa-copy fa-fw fa-sm sl-icon" role="img" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"> + <path fill="currentColor" + d="M384 96L384 0h-112c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48H464c26.51 0 48-21.49 48-48V128h-95.1C398.4 128 384 113.6 384 96zM416 0v96h96L416 0zM192 352V128h-144c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h192c26.51 0 48-21.49 48-48L288 416h-32C220.7 416 192 387.3 192 352z"></path> + </svg> + </div> + </button> + </div> + <div class="sl-panel__content-wrapper sl-bg-canvas-100 example-response-GETapi-v1-system-statistics example-response-GETapi-v1-system-statistics-0" + style=" " + > + <div class="sl-panel__content sl-p-0"> + <pre><code style="max-height: 300px;" + class="language-json sl-overflow-x-auto sl-overflow-y-auto">{ + "meta": { + "responseCode": 200, + "limit": 50, + "offset": 0, + "message": "", + "cached": false, + "availableRelations": [] + }, + "data": { + "current_page": 1, + "data": [ + { + "id": "550e8400-e29b-41d4-a716-446655440000", + "created_at": "2024-01-01 00:00:00" + } + ], + "first_page_url": "https://open-food-network-vouchers.test/api/v1/admin/system-statistics?page=1", + "from": null, + "last_page": 1, + "last_page_url": "https://open-food-network-vouchers.test/api/v1/admin/system-statistics?page=1", + "links": [ + { + "url": null, + "label": "&laquo; Previous", + "active": false + }, + { + "url": "https://open-food-network-vouchers.test/api/v1/admin/system-statistics?page=1", + "label": "1", + "active": true + }, + { + "url": null, + "label": "Next &raquo;", + "active": false + } + ], + "next_page_url": null, + "path": "https://open-food-network-vouchers.test/api/v1/admin/system-statistics", + "per_page": 1, + "prev_page_url": null, + "to": null, + "total": 0 + } +}</code></pre> + </div> + </div> + </div> + </div> + </div> +</div> + + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-relative"> + <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> + <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" + id="app-endpoints-GETapi-v1-system-statistics--id-"> + GET /{id} + </h2> + </div> + </div> + + <div class="sl-relative"> + <div title="https://vine.openfoodnetwork.org.au/api/v1/system-statistics/{id}" + class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" + > + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: green;" + > + GET + </div> + <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> + <div dir="rtl" + class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/system-statistics/{id}</div> + </div> + + <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" + style="background-color: darkred" + >requires authentication + </div> + </div> + </div> + + <p>Retrieve a single system statistic based on ID.</p> + </div> + <div class="sl-flex"> + <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> + <div class="sl-stack sl-stack--vertical sl-stack--10 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--8 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose"> + Headers + </h3> + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Authorization</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + Bearer {YOUR_API_TOKEN} + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + JWT eyJ0eXAiOiJKV... + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">URL Parameters</h3> + + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">id</div> + <span class="sl-truncate sl-text-muted">integer</span> + </div> + <div class="sl-flex-1 sl-h-px sl-mx-3"></div> + <span class="sl-ml-2 sl-text-warning">required</span> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>ID.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + 17 + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">Query Parameters</h3> + + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">cached</div> + <span class="sl-truncate sl-text-muted">boolean</span> + </div> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>Request the response to be cached. Default: <code>true</code>.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + 1 + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">fields</div> + <span class="sl-truncate sl-text-muted">string</span> + </div> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>Comma-separated list of database fields to return within the object.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + id,num_users + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + </div> + </div> + </div> + + <div data-testid="two-column-right" class="sl-relative sl-w-2/5 sl-ml-16" style="max-width: 500px;"> + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-h-lg"> + <div class="sl--ml-2"> + Example request: + <select class="example-request-lang-toggle sl-text-base" + aria-label="Request Sample Language" + onchange="switchExampleLanguage(event.target.value);"> + <option>bash</option> + <option>javascript</option> + <option>php</option> + <option>python</option> + </select> + </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-bash" + style=""> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-bash">curl --request GET \ + --get "https://vine.openfoodnetwork.org.au/api/v1/system-statistics/17?cached=1&fields=id%2Cnum_users" \ + --header "Authorization: Bearer {YOUR_API_TOKEN}" \ + --header "Content-Type: application/json" \ + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..."</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-javascript" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-javascript">const url = new URL( + "https://vine.openfoodnetwork.org.au/api/v1/system-statistics/17" +); + +const params = { + "cached": "1", + "fields": "id,num_users", +}; +Object.keys(params) + .forEach(key => url.searchParams.append(key, params[key])); + +const headers = { + "Authorization": "Bearer {YOUR_API_TOKEN}", + "Content-Type": "application/json", + "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", +}; + +fetch(url, { + method: "GET", + headers, +}).then(response => response.json());</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-php" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-php">$client = new \GuzzleHttp\Client(); +$url = 'https://vine.openfoodnetwork.org.au/api/v1/system-statistics/17'; +$response = $client->get( + $url, + [ + 'headers' => [ + 'Authorization' => 'Bearer {YOUR_API_TOKEN}', + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', + ], + 'query' => [ + 'cached' => '1', + 'fields' => 'id,num_users', + ], + ] +); +$body = $response->getBody(); +print_r(json_decode((string) $body));</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-python" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-python">import requests +import json + +url = 'https://vine.openfoodnetwork.org.au/api/v1/system-statistics/17' +params = { + 'cached': '1', + 'fields': 'id,num_users', +} +headers = { + 'Authorization': 'Bearer {YOUR_API_TOKEN}', + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' +} + +response = requests.request('GET', url, headers=headers, params=params) +response.json()</code></pre> </div> + </div> + </div> + </div> + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-py-2"> + <div class="sl--ml-2"> + <div class="sl-h-sm sl-text-base sl-font-medium sl-px-1.5 sl-text-muted sl-rounded sl-border-transparent sl-border"> + <div class="sl-mb-2 sl-inline-block">Example response:</div> + <div class="sl-mb-2 sl-inline-block"> + <select + class="example-response-GETapi-v1-system-statistics--id--toggle sl-text-base" + aria-label="Response sample" + onchange="switchExampleResponse('GETapi-v1-system-statistics--id-', event.target.value);"> + <option value="0">200</option> + </select></div> + </div> + </div> + </div> + <button type="button" + class="sl-button sl-h-sm sl-text-base sl-font-medium sl-px-1.5 hover:sl-bg-canvas-50 active:sl-bg-canvas-100 sl-text-muted hover:sl-text-body focus:sl-text-body sl-rounded sl-border-transparent sl-border disabled:sl-opacity-70"> + <div class="sl-mx-0"> + <svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="copy" + class="svg-inline--fa fa-copy fa-fw fa-sm sl-icon" role="img" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"> + <path fill="currentColor" + d="M384 96L384 0h-112c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48H464c26.51 0 48-21.49 48-48V128h-95.1C398.4 128 384 113.6 384 96zM416 0v96h96L416 0zM192 352V128h-144c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h192c26.51 0 48-21.49 48-48L288 416h-32C220.7 416 192 387.3 192 352z"></path> + </svg> + </div> + </button> + </div> + <div class="sl-panel__content-wrapper sl-bg-canvas-100 example-response-GETapi-v1-system-statistics--id- example-response-GETapi-v1-system-statistics--id--0" + style=" " + > + <div class="sl-panel__content sl-p-0"> + <pre><code style="max-height: 300px;" + class="language-json sl-overflow-x-auto sl-overflow-y-auto">{ + "meta": { + "responseCode": 200, + "limit": 50, + "offset": 0, + "message": "", + "cached": true, + "cached_at": "2024-08-13 08:58:19", + "availableRelations": [] + }, + "data": { + "id": 1, + "num_users": 3, + "num_teams": 2, + "num_voucher_sets": 0, + "num_vouchers": 0, + "num_voucher_redemptions": 0, + "sum_voucher_value_total": 0, + "sum_voucher_value_redeemed": 0, + "sum_voucher_value_remaining": 0, + "created_at": "2024-08-13T07:56:17.000000Z", + "updated_at": "2024-08-13T07:56:17.000000Z" + } +}</code></pre> + </div> + </div> + </div> + </div> + </div> +</div> + + <h2 id="app-endpoints-shops" + class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-3" + > + /shops + </h2> + <p>API for managing shops</p> + <br> + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-relative"> + <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> + <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" + id="app-endpoints-POSTapi-v1-shops"> + POST / + </h2> + </div> + </div> + + <div class="sl-relative"> + <div title="https://vine.openfoodnetwork.org.au/api/v1/shops" + class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" + > + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: black;" + > + POST + </div> + <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> + <div dir="rtl" + class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/shops</div> + </div> + + <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" + style="background-color: darkred" + >requires authentication + </div> + </div> + </div> + + <p>Create a new shop.</p> + </div> + <div class="sl-flex"> + <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> + <div class="sl-stack sl-stack--vertical sl-stack--10 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--8 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose"> + Headers + </h3> + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Authorization</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + Bearer {YOUR_API_TOKEN} + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + JWT eyJ0eXAiOiJKV... + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + + + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">Body Parameters</h3> + + <div class="sl-text-sm"> + <div class="expandable sl-text-sm sl-border-l sl-ml-px"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">shop_name</div> + <span class="sl-truncate sl-text-muted">string</span> + </div> + <div class="sl-flex-1 sl-h-px sl-mx-3"></div> + <span class="sl-ml-2 sl-text-warning">required</span> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + quisquam + </div> + </div> + </div> + </div> +</div> + + </div> + <div class="expandable sl-text-sm sl-border-l sl-ml-px"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">user_email</div> + <span class="sl-truncate sl-text-muted">string</span> + </div> + <div class="sl-flex-1 sl-h-px sl-mx-3"></div> + <span class="sl-ml-2 sl-text-warning">required</span> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>Must be a valid email address.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + nathaniel.kassulke@example.com + </div> + </div> + </div> + </div> +</div> + + </div> + <div class="expandable sl-text-sm sl-border-l sl-ml-px"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">user_name</div> + <span class="sl-truncate sl-text-muted">string</span> + </div> + <div class="sl-flex-1 sl-h-px sl-mx-3"></div> + <span class="sl-ml-2 sl-text-warning">required</span> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + ad + </div> + </div> + </div> + </div> +</div> + + </div> + </div> + </div> + + </div> + </div> + </div> + + <div data-testid="two-column-right" class="sl-relative sl-w-2/5 sl-ml-16" style="max-width: 500px;"> + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-h-lg"> + <div class="sl--ml-2"> + Example request: + <select class="example-request-lang-toggle sl-text-base" + aria-label="Request Sample Language" + onchange="switchExampleLanguage(event.target.value);"> + <option>bash</option> + <option>javascript</option> + <option>php</option> + <option>python</option> + </select> + </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-bash" + style=""> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-bash">curl --request POST \ + "https://vine.openfoodnetwork.org.au/api/v1/shops" \ + --header "Authorization: Bearer {YOUR_API_TOKEN}" \ + --header "Content-Type: application/json" \ + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..." \ + --data "{ + \"shop_name\": \"quisquam\", + \"user_email\": \"nathaniel.kassulke@example.com\", + \"user_name\": \"ad\" +}" +</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-javascript" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-javascript">const url = new URL( + "https://vine.openfoodnetwork.org.au/api/v1/shops" +); + +const headers = { + "Authorization": "Bearer {YOUR_API_TOKEN}", + "Content-Type": "application/json", + "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", +}; + +let body = { + "shop_name": "quisquam", + "user_email": "nathaniel.kassulke@example.com", + "user_name": "ad" +}; + +fetch(url, { + method: "POST", + headers, + body: JSON.stringify(body), +}).then(response => response.json());</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-php" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-php">$client = new \GuzzleHttp\Client(); +$url = 'https://vine.openfoodnetwork.org.au/api/v1/shops'; +$response = $client->post( + $url, + [ + 'headers' => [ + 'Authorization' => 'Bearer {YOUR_API_TOKEN}', + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', + ], + 'json' => [ + 'shop_name' => 'quisquam', + 'user_email' => 'nathaniel.kassulke@example.com', + 'user_name' => 'ad', + ], + ] +); +$body = $response->getBody(); +print_r(json_decode((string) $body));</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-python" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-python">import requests +import json + +url = 'https://vine.openfoodnetwork.org.au/api/v1/shops' +payload = { + "shop_name": "quisquam", + "user_email": "nathaniel.kassulke@example.com", + "user_name": "ad" +} +headers = { + 'Authorization': 'Bearer {YOUR_API_TOKEN}', + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' +} + +response = requests.request('POST', url, headers=headers, json=payload) +response.json()</code></pre> </div> + </div> + </div> + </div> + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-py-2"> + <div class="sl--ml-2"> + <div class="sl-h-sm sl-text-base sl-font-medium sl-px-1.5 sl-text-muted sl-rounded sl-border-transparent sl-border"> + <div class="sl-mb-2 sl-inline-block">Example response:</div> + <div class="sl-mb-2 sl-inline-block"> + <select + class="example-response-POSTapi-v1-shops-toggle sl-text-base" + aria-label="Response sample" + onchange="switchExampleResponse('POSTapi-v1-shops', event.target.value);"> + <option value="0">200</option> + </select></div> + </div> + </div> + </div> + <button type="button" + class="sl-button sl-h-sm sl-text-base sl-font-medium sl-px-1.5 hover:sl-bg-canvas-50 active:sl-bg-canvas-100 sl-text-muted hover:sl-text-body focus:sl-text-body sl-rounded sl-border-transparent sl-border disabled:sl-opacity-70"> + <div class="sl-mx-0"> + <svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="copy" + class="svg-inline--fa fa-copy fa-fw fa-sm sl-icon" role="img" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"> + <path fill="currentColor" + d="M384 96L384 0h-112c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48H464c26.51 0 48-21.49 48-48V128h-95.1C398.4 128 384 113.6 384 96zM416 0v96h96L416 0zM192 352V128h-144c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h192c26.51 0 48-21.49 48-48L288 416h-32C220.7 416 192 387.3 192 352z"></path> + </svg> + </div> + </button> + </div> + <div class="sl-panel__content-wrapper sl-bg-canvas-100 example-response-POSTapi-v1-shops example-response-POSTapi-v1-shops-0" + style=" " + > + <div class="sl-panel__content sl-p-0"> + <pre><code style="max-height: 300px;" + class="language-json sl-overflow-x-auto sl-overflow-y-auto">{ + "meta": { + "responseCode": 200, + "limit": 50, + "offset": 0, + "message": "Saved. Here is the API Token for the user linked to this new team. It will only be displayed ONCE, so please store it in a secure manner.", + "cached": false, + "availableRelations": [] + }, + "data": { + "token": "123|kjfhsgiufsghkjsfghkfgsjh" + } +}</code></pre> + </div> + </div> + </div> + </div> + </div> +</div> + + <h1 id="endpoints" + class="sl-text-5xl sl-leading-tight sl-font-prose sl-text-heading" + > + Endpoints + </h1> + + + + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-relative"> + <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> + <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" + id="endpoints-GETapi-v1-admin-audit-items"> + GET / + </h2> + </div> + </div> + + <div class="sl-relative"> + <div title="https://vine.openfoodnetwork.org.au/api/v1/admin/audit-items" + class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" + > + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: green;" + > + GET + </div> + <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> + <div dir="rtl" + class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/admin/audit-items</div> + </div> + + <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" + style="background-color: darkred" + >requires authentication + </div> + </div> + </div> + + + </div> + <div class="sl-flex"> + <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> + <div class="sl-stack sl-stack--vertical sl-stack--10 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--8 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose"> + Headers + </h3> + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Authorization</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + Bearer {YOUR_API_TOKEN} + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + JWT eyJ0eXAiOiJKV... + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + + + + </div> + </div> + </div> + + <div data-testid="two-column-right" class="sl-relative sl-w-2/5 sl-ml-16" style="max-width: 500px;"> + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-h-lg"> + <div class="sl--ml-2"> + Example request: + <select class="example-request-lang-toggle sl-text-base" + aria-label="Request Sample Language" + onchange="switchExampleLanguage(event.target.value);"> + <option>bash</option> + <option>javascript</option> + <option>php</option> + <option>python</option> + </select> + </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-bash" + style=""> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-bash">curl --request GET \ + --get "https://vine.openfoodnetwork.org.au/api/v1/admin/audit-items" \ + --header "Authorization: Bearer {YOUR_API_TOKEN}" \ + --header "Content-Type: application/json" \ + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..."</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-javascript" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-javascript">const url = new URL( + "https://vine.openfoodnetwork.org.au/api/v1/admin/audit-items" +); + +const headers = { + "Authorization": "Bearer {YOUR_API_TOKEN}", + "Content-Type": "application/json", + "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", +}; + +fetch(url, { + method: "GET", + headers, +}).then(response => response.json());</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-php" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-php">$client = new \GuzzleHttp\Client(); +$url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/audit-items'; +$response = $client->get( + $url, + [ + 'headers' => [ + 'Authorization' => 'Bearer {YOUR_API_TOKEN}', + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', + ], + ] +); +$body = $response->getBody(); +print_r(json_decode((string) $body));</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-python" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-python">import requests +import json + +url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/audit-items' +headers = { + 'Authorization': 'Bearer {YOUR_API_TOKEN}', + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' +} + +response = requests.request('GET', url, headers=headers) +response.json()</code></pre> </div> + </div> + </div> + </div> + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-py-2"> + <div class="sl--ml-2"> + <div class="sl-h-sm sl-text-base sl-font-medium sl-px-1.5 sl-text-muted sl-rounded sl-border-transparent sl-border"> + <div class="sl-mb-2 sl-inline-block">Example response:</div> + <div class="sl-mb-2 sl-inline-block"> + <select + class="example-response-GETapi-v1-admin-audit-items-toggle sl-text-base" + aria-label="Response sample" + onchange="switchExampleResponse('GETapi-v1-admin-audit-items', event.target.value);"> + <option value="0">401</option> + </select></div> + </div> + </div> + </div> + <button type="button" + class="sl-button sl-h-sm sl-text-base sl-font-medium sl-px-1.5 hover:sl-bg-canvas-50 active:sl-bg-canvas-100 sl-text-muted hover:sl-text-body focus:sl-text-body sl-rounded sl-border-transparent sl-border disabled:sl-opacity-70"> + <div class="sl-mx-0"> + <svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="copy" + class="svg-inline--fa fa-copy fa-fw fa-sm sl-icon" role="img" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"> + <path fill="currentColor" + d="M384 96L384 0h-112c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48H464c26.51 0 48-21.49 48-48V128h-95.1C398.4 128 384 113.6 384 96zM416 0v96h96L416 0zM192 352V128h-144c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h192c26.51 0 48-21.49 48-48L288 416h-32C220.7 416 192 387.3 192 352z"></path> + </svg> + </div> + </button> + </div> + <div class="sl-panel__content-wrapper sl-bg-canvas-100 example-response-GETapi-v1-admin-audit-items example-response-GETapi-v1-admin-audit-items-0" + style=" " + > + <div class="sl-panel__content sl-p-0"> <details class="sl-pl-2"> + <summary style="cursor: pointer; list-style: none;"> + <small> + <span class="expansion-chevrons"> + + <svg aria-hidden="true" focusable="false" data-prefix="fas" + data-icon="chevron-right" + class="svg-inline--fa fa-chevron-right fa-fw sl-icon sl-text-muted" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"> + <path fill="currentColor" + d="M96 480c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L242.8 256L73.38 86.63c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l192 192c12.5 12.5 12.5 32.75 0 45.25l-192 192C112.4 476.9 104.2 480 96 480z"></path> + </svg> + </span> + Headers + </small> + </summary> + <pre><code class="language-http"> cache-control + : no-cache, private + content-type + : application/json + access-control-allow-origin + : * + </code></pre> + </details> + + <pre><code style="max-height: 300px;" + class="language-json sl-overflow-x-auto sl-overflow-y-auto">{ + "message": "Unauthenticated." +}</code></pre> + </div> + </div> + </div> + </div> + </div> +</div> + + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-relative"> + <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> + <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" + id="endpoints-POSTapi-v1-admin-audit-items"> + POST / + </h2> + </div> + </div> + + <div class="sl-relative"> + <div title="https://vine.openfoodnetwork.org.au/api/v1/admin/audit-items" + class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" + > + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: black;" + > + POST + </div> + <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> + <div dir="rtl" + class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/admin/audit-items</div> + </div> + + <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" + style="background-color: darkred" + >requires authentication + </div> + </div> + </div> + + + </div> + <div class="sl-flex"> + <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> + <div class="sl-stack sl-stack--vertical sl-stack--10 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--8 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose"> + Headers + </h3> + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Authorization</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + Bearer {YOUR_API_TOKEN} + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + JWT eyJ0eXAiOiJKV... + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + + + + </div> + </div> + </div> + + <div data-testid="two-column-right" class="sl-relative sl-w-2/5 sl-ml-16" style="max-width: 500px;"> + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-h-lg"> + <div class="sl--ml-2"> + Example request: + <select class="example-request-lang-toggle sl-text-base" + aria-label="Request Sample Language" + onchange="switchExampleLanguage(event.target.value);"> + <option>bash</option> + <option>javascript</option> + <option>php</option> + <option>python</option> + </select> + </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-bash" + style=""> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-bash">curl --request POST \ + "https://vine.openfoodnetwork.org.au/api/v1/admin/audit-items" \ + --header "Authorization: Bearer {YOUR_API_TOKEN}" \ + --header "Content-Type: application/json" \ + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..."</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-javascript" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-javascript">const url = new URL( + "https://vine.openfoodnetwork.org.au/api/v1/admin/audit-items" +); + +const headers = { + "Authorization": "Bearer {YOUR_API_TOKEN}", + "Content-Type": "application/json", + "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", +}; + +fetch(url, { + method: "POST", + headers, +}).then(response => response.json());</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-php" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-php">$client = new \GuzzleHttp\Client(); +$url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/audit-items'; +$response = $client->post( + $url, + [ + 'headers' => [ + 'Authorization' => 'Bearer {YOUR_API_TOKEN}', + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', + ], + ] +); +$body = $response->getBody(); +print_r(json_decode((string) $body));</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-python" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-python">import requests +import json + +url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/audit-items' +headers = { + 'Authorization': 'Bearer {YOUR_API_TOKEN}', + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' +} + +response = requests.request('POST', url, headers=headers) +response.json()</code></pre> </div> + </div> + </div> + </div> + + </div> + </div> +</div> + + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-relative"> + <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> + <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" + id="endpoints-GETapi-v1-admin-audit-items--id-"> + GET /{id} + </h2> + </div> + </div> + + <div class="sl-relative"> + <div title="https://vine.openfoodnetwork.org.au/api/v1/admin/audit-items/{id}" + class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" + > + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: green;" + > + GET + </div> + <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> + <div dir="rtl" + class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/admin/audit-items/{id}</div> + </div> + + <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" + style="background-color: darkred" + >requires authentication + </div> + </div> + </div> + + + </div> + <div class="sl-flex"> + <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> + <div class="sl-stack sl-stack--vertical sl-stack--10 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--8 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose"> + Headers + </h3> + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Authorization</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + Bearer {YOUR_API_TOKEN} + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + JWT eyJ0eXAiOiJKV... + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">URL Parameters</h3> + + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">id</div> + <span class="sl-truncate sl-text-muted">string</span> + </div> + <div class="sl-flex-1 sl-h-px sl-mx-3"></div> + <span class="sl-ml-2 sl-text-warning">required</span> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>The ID of the audit item.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + placeat + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + + + </div> + </div> + </div> + + <div data-testid="two-column-right" class="sl-relative sl-w-2/5 sl-ml-16" style="max-width: 500px;"> + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-h-lg"> + <div class="sl--ml-2"> + Example request: + <select class="example-request-lang-toggle sl-text-base" + aria-label="Request Sample Language" + onchange="switchExampleLanguage(event.target.value);"> + <option>bash</option> + <option>javascript</option> + <option>php</option> + <option>python</option> + </select> + </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-bash" + style=""> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-bash">curl --request GET \ + --get "https://vine.openfoodnetwork.org.au/api/v1/admin/audit-items/placeat" \ + --header "Authorization: Bearer {YOUR_API_TOKEN}" \ + --header "Content-Type: application/json" \ + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..."</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-javascript" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-javascript">const url = new URL( + "https://vine.openfoodnetwork.org.au/api/v1/admin/audit-items/placeat" +); + +const headers = { + "Authorization": "Bearer {YOUR_API_TOKEN}", + "Content-Type": "application/json", + "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", +}; + +fetch(url, { + method: "GET", + headers, +}).then(response => response.json());</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-php" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-php">$client = new \GuzzleHttp\Client(); +$url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/audit-items/placeat'; +$response = $client->get( + $url, + [ + 'headers' => [ + 'Authorization' => 'Bearer {YOUR_API_TOKEN}', + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', + ], + ] +); +$body = $response->getBody(); +print_r(json_decode((string) $body));</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-python" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-python">import requests +import json + +url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/audit-items/placeat' +headers = { + 'Authorization': 'Bearer {YOUR_API_TOKEN}', + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' +} + +response = requests.request('GET', url, headers=headers) +response.json()</code></pre> </div> + </div> + </div> + </div> + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-py-2"> + <div class="sl--ml-2"> + <div class="sl-h-sm sl-text-base sl-font-medium sl-px-1.5 sl-text-muted sl-rounded sl-border-transparent sl-border"> + <div class="sl-mb-2 sl-inline-block">Example response:</div> + <div class="sl-mb-2 sl-inline-block"> + <select + class="example-response-GETapi-v1-admin-audit-items--id--toggle sl-text-base" + aria-label="Response sample" + onchange="switchExampleResponse('GETapi-v1-admin-audit-items--id-', event.target.value);"> + <option value="0">401</option> + </select></div> + </div> + </div> + </div> + <button type="button" + class="sl-button sl-h-sm sl-text-base sl-font-medium sl-px-1.5 hover:sl-bg-canvas-50 active:sl-bg-canvas-100 sl-text-muted hover:sl-text-body focus:sl-text-body sl-rounded sl-border-transparent sl-border disabled:sl-opacity-70"> + <div class="sl-mx-0"> + <svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="copy" + class="svg-inline--fa fa-copy fa-fw fa-sm sl-icon" role="img" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"> + <path fill="currentColor" + d="M384 96L384 0h-112c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48H464c26.51 0 48-21.49 48-48V128h-95.1C398.4 128 384 113.6 384 96zM416 0v96h96L416 0zM192 352V128h-144c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h192c26.51 0 48-21.49 48-48L288 416h-32C220.7 416 192 387.3 192 352z"></path> + </svg> + </div> + </button> + </div> + <div class="sl-panel__content-wrapper sl-bg-canvas-100 example-response-GETapi-v1-admin-audit-items--id- example-response-GETapi-v1-admin-audit-items--id--0" + style=" " + > + <div class="sl-panel__content sl-p-0"> <details class="sl-pl-2"> + <summary style="cursor: pointer; list-style: none;"> + <small> + <span class="expansion-chevrons"> + + <svg aria-hidden="true" focusable="false" data-prefix="fas" + data-icon="chevron-right" + class="svg-inline--fa fa-chevron-right fa-fw sl-icon sl-text-muted" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"> + <path fill="currentColor" + d="M96 480c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L242.8 256L73.38 86.63c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l192 192c12.5 12.5 12.5 32.75 0 45.25l-192 192C112.4 476.9 104.2 480 96 480z"></path> + </svg> + </span> + Headers + </small> + </summary> + <pre><code class="language-http"> cache-control + : no-cache, private + content-type + : application/json + access-control-allow-origin + : * + </code></pre> + </details> + + <pre><code style="max-height: 300px;" + class="language-json sl-overflow-x-auto sl-overflow-y-auto">{ + "message": "Unauthenticated." +}</code></pre> + </div> + </div> + </div> + </div> + </div> +</div> + + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-relative"> + <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> + <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" + id="endpoints-PUTapi-v1-admin-audit-items--id-"> + PUT /{id} + </h2> + </div> + </div> + + <div class="sl-relative"> + <div title="https://vine.openfoodnetwork.org.au/api/v1/admin/audit-items/{id}" + class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" + > + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: darkblue;" + > + PUT + </div> + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: purple;" + > + PATCH + </div> + <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> + <div dir="rtl" + class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/admin/audit-items/{id}</div> + </div> + + <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" + style="background-color: darkred" + >requires authentication + </div> + </div> + </div> + + + </div> + <div class="sl-flex"> + <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> + <div class="sl-stack sl-stack--vertical sl-stack--10 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--8 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose"> + Headers + </h3> + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Authorization</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + Bearer {YOUR_API_TOKEN} + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + JWT eyJ0eXAiOiJKV... + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">URL Parameters</h3> + + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">id</div> + <span class="sl-truncate sl-text-muted">string</span> + </div> + <div class="sl-flex-1 sl-h-px sl-mx-3"></div> + <span class="sl-ml-2 sl-text-warning">required</span> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>The ID of the audit item.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + ut + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + + + </div> + </div> + </div> + + <div data-testid="two-column-right" class="sl-relative sl-w-2/5 sl-ml-16" style="max-width: 500px;"> + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-h-lg"> + <div class="sl--ml-2"> + Example request: + <select class="example-request-lang-toggle sl-text-base" + aria-label="Request Sample Language" + onchange="switchExampleLanguage(event.target.value);"> + <option>bash</option> + <option>javascript</option> + <option>php</option> + <option>python</option> + </select> + </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-bash" + style=""> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-bash">curl --request PUT \ + "https://vine.openfoodnetwork.org.au/api/v1/admin/audit-items/ut" \ + --header "Authorization: Bearer {YOUR_API_TOKEN}" \ + --header "Content-Type: application/json" \ + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..."</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-javascript" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-javascript">const url = new URL( + "https://vine.openfoodnetwork.org.au/api/v1/admin/audit-items/ut" +); + +const headers = { + "Authorization": "Bearer {YOUR_API_TOKEN}", + "Content-Type": "application/json", + "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", +}; + +fetch(url, { + method: "PUT", + headers, +}).then(response => response.json());</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-php" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-php">$client = new \GuzzleHttp\Client(); +$url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/audit-items/ut'; +$response = $client->put( + $url, + [ + 'headers' => [ + 'Authorization' => 'Bearer {YOUR_API_TOKEN}', + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', + ], + ] +); +$body = $response->getBody(); +print_r(json_decode((string) $body));</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-python" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-python">import requests +import json + +url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/audit-items/ut' +headers = { + 'Authorization': 'Bearer {YOUR_API_TOKEN}', + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' +} + +response = requests.request('PUT', url, headers=headers) +response.json()</code></pre> </div> + </div> + </div> + </div> + + </div> + </div> +</div> + + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-relative"> + <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> + <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" + id="endpoints-DELETEapi-v1-admin-audit-items--id-"> + DELETE / {id} + </h2> + </div> + </div> + + <div class="sl-relative"> + <div title="https://vine.openfoodnetwork.org.au/api/v1/admin/audit-items/{id}" + class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" + > + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: red;" + > + DELETE + </div> + <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> + <div dir="rtl" + class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/admin/audit-items/{id}</div> + </div> + + <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" + style="background-color: darkred" + >requires authentication + </div> + </div> + </div> + + + </div> + <div class="sl-flex"> + <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> + <div class="sl-stack sl-stack--vertical sl-stack--10 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--8 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose"> + Headers + </h3> + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Authorization</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + Bearer {YOUR_API_TOKEN} + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + JWT eyJ0eXAiOiJKV... + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">URL Parameters</h3> + + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">id</div> + <span class="sl-truncate sl-text-muted">string</span> + </div> + <div class="sl-flex-1 sl-h-px sl-mx-3"></div> + <span class="sl-ml-2 sl-text-warning">required</span> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>The ID of the audit item.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + quis + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + + + </div> + </div> + </div> + + <div data-testid="two-column-right" class="sl-relative sl-w-2/5 sl-ml-16" style="max-width: 500px;"> + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-h-lg"> + <div class="sl--ml-2"> + Example request: + <select class="example-request-lang-toggle sl-text-base" + aria-label="Request Sample Language" + onchange="switchExampleLanguage(event.target.value);"> + <option>bash</option> + <option>javascript</option> + <option>php</option> + <option>python</option> + </select> + </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-bash" + style=""> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-bash">curl --request DELETE \ + "https://vine.openfoodnetwork.org.au/api/v1/admin/audit-items/quis" \ + --header "Authorization: Bearer {YOUR_API_TOKEN}" \ + --header "Content-Type: application/json" \ + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..."</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-javascript" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-javascript">const url = new URL( + "https://vine.openfoodnetwork.org.au/api/v1/admin/audit-items/quis" +); + +const headers = { + "Authorization": "Bearer {YOUR_API_TOKEN}", + "Content-Type": "application/json", + "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", +}; + +fetch(url, { + method: "DELETE", + headers, +}).then(response => response.json());</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-php" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-php">$client = new \GuzzleHttp\Client(); +$url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/audit-items/quis'; +$response = $client->delete( + $url, + [ + 'headers' => [ + 'Authorization' => 'Bearer {YOUR_API_TOKEN}', + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', + ], + ] +); +$body = $response->getBody(); +print_r(json_decode((string) $body));</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-python" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-python">import requests +import json + +url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/audit-items/quis' +headers = { + 'Authorization': 'Bearer {YOUR_API_TOKEN}', + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' +} + +response = requests.request('DELETE', url, headers=headers) +response.json()</code></pre> </div> + </div> + </div> + </div> + + </div> + </div> +</div> + + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-relative"> + <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> + <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" + id="endpoints-GETapi-v1-admin-search"> + GET / + </h2> + </div> + </div> + + <div class="sl-relative"> + <div title="https://vine.openfoodnetwork.org.au/api/v1/admin/search" + class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" + > + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: green;" + > + GET + </div> + <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> + <div dir="rtl" + class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/admin/search</div> + </div> + + <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" + style="background-color: darkred" + >requires authentication + </div> + </div> + </div> + + + </div> + <div class="sl-flex"> + <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> + <div class="sl-stack sl-stack--vertical sl-stack--10 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--8 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose"> + Headers + </h3> + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Authorization</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + Bearer {YOUR_API_TOKEN} + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + JWT eyJ0eXAiOiJKV... + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + + + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">Body Parameters</h3> + + <div class="sl-text-sm"> + <div class="expandable sl-text-sm sl-border-l sl-ml-px"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">query</div> + <span class="sl-truncate sl-text-muted">string</span> + </div> + <div class="sl-flex-1 sl-h-px sl-mx-3"></div> + <span class="sl-ml-2 sl-text-warning">required</span> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>Must be at least 3 characters.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + bfoycjjubqdtkjdvuaufzppdkcndqbkutiawnyjghwaoms + </div> + </div> + </div> + </div> +</div> + + </div> + </div> + </div> + + </div> + </div> + </div> + + <div data-testid="two-column-right" class="sl-relative sl-w-2/5 sl-ml-16" style="max-width: 500px;"> + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-h-lg"> + <div class="sl--ml-2"> + Example request: + <select class="example-request-lang-toggle sl-text-base" + aria-label="Request Sample Language" + onchange="switchExampleLanguage(event.target.value);"> + <option>bash</option> + <option>javascript</option> + <option>php</option> + <option>python</option> + </select> + </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-bash" + style=""> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-bash">curl --request GET \ + --get "https://vine.openfoodnetwork.org.au/api/v1/admin/search" \ + --header "Authorization: Bearer {YOUR_API_TOKEN}" \ + --header "Content-Type: application/json" \ + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..." \ + --data "{ + \"query\": \"bfoycjjubqdtkjdvuaufzppdkcndqbkutiawnyjghwaoms\" +}" +</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-javascript" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-javascript">const url = new URL( + "https://vine.openfoodnetwork.org.au/api/v1/admin/search" +); + +const headers = { + "Authorization": "Bearer {YOUR_API_TOKEN}", + "Content-Type": "application/json", + "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", +}; + +let body = { + "query": "bfoycjjubqdtkjdvuaufzppdkcndqbkutiawnyjghwaoms" +}; + +fetch(url, { + method: "GET", + headers, + body: JSON.stringify(body), +}).then(response => response.json());</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-php" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-php">$client = new \GuzzleHttp\Client(); +$url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/search'; +$response = $client->get( + $url, + [ + 'headers' => [ + 'Authorization' => 'Bearer {YOUR_API_TOKEN}', + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', + ], + 'json' => [ + 'query' => 'bfoycjjubqdtkjdvuaufzppdkcndqbkutiawnyjghwaoms', + ], + ] +); +$body = $response->getBody(); +print_r(json_decode((string) $body));</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-python" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-python">import requests +import json + +url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/search' +payload = { + "query": "bfoycjjubqdtkjdvuaufzppdkcndqbkutiawnyjghwaoms" +} +headers = { + 'Authorization': 'Bearer {YOUR_API_TOKEN}', + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' +} + +response = requests.request('GET', url, headers=headers, json=payload) +response.json()</code></pre> </div> + </div> + </div> + </div> + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-py-2"> + <div class="sl--ml-2"> + <div class="sl-h-sm sl-text-base sl-font-medium sl-px-1.5 sl-text-muted sl-rounded sl-border-transparent sl-border"> + <div class="sl-mb-2 sl-inline-block">Example response:</div> + <div class="sl-mb-2 sl-inline-block"> + <select + class="example-response-GETapi-v1-admin-search-toggle sl-text-base" + aria-label="Response sample" + onchange="switchExampleResponse('GETapi-v1-admin-search', event.target.value);"> + <option value="0">401</option> + </select></div> + </div> + </div> + </div> + <button type="button" + class="sl-button sl-h-sm sl-text-base sl-font-medium sl-px-1.5 hover:sl-bg-canvas-50 active:sl-bg-canvas-100 sl-text-muted hover:sl-text-body focus:sl-text-body sl-rounded sl-border-transparent sl-border disabled:sl-opacity-70"> + <div class="sl-mx-0"> + <svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="copy" + class="svg-inline--fa fa-copy fa-fw fa-sm sl-icon" role="img" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"> + <path fill="currentColor" + d="M384 96L384 0h-112c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48H464c26.51 0 48-21.49 48-48V128h-95.1C398.4 128 384 113.6 384 96zM416 0v96h96L416 0zM192 352V128h-144c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h192c26.51 0 48-21.49 48-48L288 416h-32C220.7 416 192 387.3 192 352z"></path> + </svg> + </div> + </button> + </div> + <div class="sl-panel__content-wrapper sl-bg-canvas-100 example-response-GETapi-v1-admin-search example-response-GETapi-v1-admin-search-0" + style=" " + > + <div class="sl-panel__content sl-p-0"> <details class="sl-pl-2"> + <summary style="cursor: pointer; list-style: none;"> + <small> + <span class="expansion-chevrons"> + + <svg aria-hidden="true" focusable="false" data-prefix="fas" + data-icon="chevron-right" + class="svg-inline--fa fa-chevron-right fa-fw sl-icon sl-text-muted" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"> + <path fill="currentColor" + d="M96 480c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L242.8 256L73.38 86.63c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l192 192c12.5 12.5 12.5 32.75 0 45.25l-192 192C112.4 476.9 104.2 480 96 480z"></path> + </svg> + </span> + Headers + </small> + </summary> + <pre><code class="language-http"> cache-control + : no-cache, private + content-type + : application/json + access-control-allow-origin + : * + </code></pre> + </details> + + <pre><code style="max-height: 300px;" + class="language-json sl-overflow-x-auto sl-overflow-y-auto">{ + "message": "Unauthenticated." +}</code></pre> + </div> + </div> + </div> + </div> + </div> +</div> + + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-relative"> + <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> + <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" + id="endpoints-POSTapi-v1-admin-search"> + POST / + </h2> + </div> + </div> + + <div class="sl-relative"> + <div title="https://vine.openfoodnetwork.org.au/api/v1/admin/search" + class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" + > + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: black;" + > + POST + </div> + <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> + <div dir="rtl" + class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/admin/search</div> + </div> + + <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" + style="background-color: darkred" + >requires authentication + </div> + </div> + </div> + + + </div> + <div class="sl-flex"> + <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> + <div class="sl-stack sl-stack--vertical sl-stack--10 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--8 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose"> + Headers + </h3> + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Authorization</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + Bearer {YOUR_API_TOKEN} + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + JWT eyJ0eXAiOiJKV... + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + + + + </div> + </div> + </div> + + <div data-testid="two-column-right" class="sl-relative sl-w-2/5 sl-ml-16" style="max-width: 500px;"> + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-h-lg"> + <div class="sl--ml-2"> + Example request: + <select class="example-request-lang-toggle sl-text-base" + aria-label="Request Sample Language" + onchange="switchExampleLanguage(event.target.value);"> + <option>bash</option> + <option>javascript</option> + <option>php</option> + <option>python</option> + </select> + </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-bash" + style=""> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-bash">curl --request POST \ + "https://vine.openfoodnetwork.org.au/api/v1/admin/search" \ + --header "Authorization: Bearer {YOUR_API_TOKEN}" \ + --header "Content-Type: application/json" \ + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..."</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-javascript" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-javascript">const url = new URL( + "https://vine.openfoodnetwork.org.au/api/v1/admin/search" +); + +const headers = { + "Authorization": "Bearer {YOUR_API_TOKEN}", + "Content-Type": "application/json", + "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", +}; + +fetch(url, { + method: "POST", + headers, +}).then(response => response.json());</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-php" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-php">$client = new \GuzzleHttp\Client(); +$url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/search'; +$response = $client->post( + $url, + [ + 'headers' => [ + 'Authorization' => 'Bearer {YOUR_API_TOKEN}', + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', + ], + ] +); +$body = $response->getBody(); +print_r(json_decode((string) $body));</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-python" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-python">import requests +import json + +url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/search' +headers = { + 'Authorization': 'Bearer {YOUR_API_TOKEN}', + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' +} + +response = requests.request('POST', url, headers=headers) +response.json()</code></pre> </div> + </div> + </div> + </div> + + </div> + </div> +</div> + + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-relative"> + <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> + <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" + id="endpoints-GETapi-v1-admin-search--id-"> + GET /{id} + </h2> + </div> + </div> + + <div class="sl-relative"> + <div title="https://vine.openfoodnetwork.org.au/api/v1/admin/search/{id}" + class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" + > + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: green;" + > + GET + </div> + <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> + <div dir="rtl" + class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/admin/search/{id}</div> + </div> + + <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" + style="background-color: darkred" + >requires authentication + </div> + </div> + </div> + + + </div> + <div class="sl-flex"> + <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> + <div class="sl-stack sl-stack--vertical sl-stack--10 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--8 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose"> + Headers + </h3> + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Authorization</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + Bearer {YOUR_API_TOKEN} + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + JWT eyJ0eXAiOiJKV... + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">URL Parameters</h3> + + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">id</div> + <span class="sl-truncate sl-text-muted">string</span> + </div> + <div class="sl-flex-1 sl-h-px sl-mx-3"></div> + <span class="sl-ml-2 sl-text-warning">required</span> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>The ID of the search.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + architecto + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + + + </div> + </div> + </div> + + <div data-testid="two-column-right" class="sl-relative sl-w-2/5 sl-ml-16" style="max-width: 500px;"> + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-h-lg"> + <div class="sl--ml-2"> + Example request: + <select class="example-request-lang-toggle sl-text-base" + aria-label="Request Sample Language" + onchange="switchExampleLanguage(event.target.value);"> + <option>bash</option> + <option>javascript</option> + <option>php</option> + <option>python</option> + </select> + </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-bash" + style=""> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-bash">curl --request GET \ + --get "https://vine.openfoodnetwork.org.au/api/v1/admin/search/architecto" \ + --header "Authorization: Bearer {YOUR_API_TOKEN}" \ + --header "Content-Type: application/json" \ + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..."</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-javascript" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-javascript">const url = new URL( + "https://vine.openfoodnetwork.org.au/api/v1/admin/search/architecto" +); + +const headers = { + "Authorization": "Bearer {YOUR_API_TOKEN}", + "Content-Type": "application/json", + "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", +}; + +fetch(url, { + method: "GET", + headers, +}).then(response => response.json());</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-php" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-php">$client = new \GuzzleHttp\Client(); +$url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/search/architecto'; +$response = $client->get( + $url, + [ + 'headers' => [ + 'Authorization' => 'Bearer {YOUR_API_TOKEN}', + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', + ], + ] +); +$body = $response->getBody(); +print_r(json_decode((string) $body));</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-python" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-python">import requests +import json + +url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/search/architecto' +headers = { + 'Authorization': 'Bearer {YOUR_API_TOKEN}', + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' +} + +response = requests.request('GET', url, headers=headers) +response.json()</code></pre> </div> + </div> + </div> + </div> + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-py-2"> + <div class="sl--ml-2"> + <div class="sl-h-sm sl-text-base sl-font-medium sl-px-1.5 sl-text-muted sl-rounded sl-border-transparent sl-border"> + <div class="sl-mb-2 sl-inline-block">Example response:</div> + <div class="sl-mb-2 sl-inline-block"> + <select + class="example-response-GETapi-v1-admin-search--id--toggle sl-text-base" + aria-label="Response sample" + onchange="switchExampleResponse('GETapi-v1-admin-search--id-', event.target.value);"> + <option value="0">401</option> + </select></div> + </div> + </div> + </div> + <button type="button" + class="sl-button sl-h-sm sl-text-base sl-font-medium sl-px-1.5 hover:sl-bg-canvas-50 active:sl-bg-canvas-100 sl-text-muted hover:sl-text-body focus:sl-text-body sl-rounded sl-border-transparent sl-border disabled:sl-opacity-70"> + <div class="sl-mx-0"> + <svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="copy" + class="svg-inline--fa fa-copy fa-fw fa-sm sl-icon" role="img" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"> + <path fill="currentColor" + d="M384 96L384 0h-112c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48H464c26.51 0 48-21.49 48-48V128h-95.1C398.4 128 384 113.6 384 96zM416 0v96h96L416 0zM192 352V128h-144c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h192c26.51 0 48-21.49 48-48L288 416h-32C220.7 416 192 387.3 192 352z"></path> + </svg> + </div> + </button> + </div> + <div class="sl-panel__content-wrapper sl-bg-canvas-100 example-response-GETapi-v1-admin-search--id- example-response-GETapi-v1-admin-search--id--0" + style=" " + > + <div class="sl-panel__content sl-p-0"> <details class="sl-pl-2"> + <summary style="cursor: pointer; list-style: none;"> + <small> + <span class="expansion-chevrons"> + + <svg aria-hidden="true" focusable="false" data-prefix="fas" + data-icon="chevron-right" + class="svg-inline--fa fa-chevron-right fa-fw sl-icon sl-text-muted" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"> + <path fill="currentColor" + d="M96 480c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L242.8 256L73.38 86.63c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l192 192c12.5 12.5 12.5 32.75 0 45.25l-192 192C112.4 476.9 104.2 480 96 480z"></path> + </svg> + </span> + Headers + </small> + </summary> + <pre><code class="language-http"> cache-control + : no-cache, private + content-type + : application/json + access-control-allow-origin + : * + </code></pre> + </details> + + <pre><code style="max-height: 300px;" + class="language-json sl-overflow-x-auto sl-overflow-y-auto">{ + "message": "Unauthenticated." +}</code></pre> + </div> + </div> + </div> + </div> + </div> +</div> + + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-relative"> + <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> + <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" + id="endpoints-PUTapi-v1-admin-search--id-"> + PUT /{id} + </h2> + </div> + </div> + + <div class="sl-relative"> + <div title="https://vine.openfoodnetwork.org.au/api/v1/admin/search/{id}" + class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" + > + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: darkblue;" + > + PUT + </div> + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: purple;" + > + PATCH + </div> + <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> + <div dir="rtl" + class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/admin/search/{id}</div> + </div> + + <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" + style="background-color: darkred" + >requires authentication + </div> + </div> + </div> + + + </div> + <div class="sl-flex"> + <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> + <div class="sl-stack sl-stack--vertical sl-stack--10 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--8 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose"> + Headers + </h3> + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Authorization</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + Bearer {YOUR_API_TOKEN} + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + JWT eyJ0eXAiOiJKV... + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">URL Parameters</h3> + + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">id</div> + <span class="sl-truncate sl-text-muted">string</span> + </div> + <div class="sl-flex-1 sl-h-px sl-mx-3"></div> + <span class="sl-ml-2 sl-text-warning">required</span> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>The ID of the search.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + eum + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + + + </div> + </div> + </div> + + <div data-testid="two-column-right" class="sl-relative sl-w-2/5 sl-ml-16" style="max-width: 500px;"> + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-h-lg"> + <div class="sl--ml-2"> + Example request: + <select class="example-request-lang-toggle sl-text-base" + aria-label="Request Sample Language" + onchange="switchExampleLanguage(event.target.value);"> + <option>bash</option> + <option>javascript</option> + <option>php</option> + <option>python</option> + </select> + </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-bash" + style=""> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-bash">curl --request PUT \ + "https://vine.openfoodnetwork.org.au/api/v1/admin/search/eum" \ + --header "Authorization: Bearer {YOUR_API_TOKEN}" \ + --header "Content-Type: application/json" \ + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..."</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-javascript" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-javascript">const url = new URL( + "https://vine.openfoodnetwork.org.au/api/v1/admin/search/eum" +); + +const headers = { + "Authorization": "Bearer {YOUR_API_TOKEN}", + "Content-Type": "application/json", + "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", +}; + +fetch(url, { + method: "PUT", + headers, +}).then(response => response.json());</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-php" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-php">$client = new \GuzzleHttp\Client(); +$url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/search/eum'; +$response = $client->put( + $url, + [ + 'headers' => [ + 'Authorization' => 'Bearer {YOUR_API_TOKEN}', + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', + ], + ] +); +$body = $response->getBody(); +print_r(json_decode((string) $body));</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-python" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-python">import requests +import json + +url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/search/eum' +headers = { + 'Authorization': 'Bearer {YOUR_API_TOKEN}', + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' +} + +response = requests.request('PUT', url, headers=headers) +response.json()</code></pre> </div> + </div> + </div> + </div> + + </div> + </div> +</div> + + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-relative"> + <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> + <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" + id="endpoints-DELETEapi-v1-admin-search--id-"> + DELETE / {id} + </h2> + </div> + </div> + + <div class="sl-relative"> + <div title="https://vine.openfoodnetwork.org.au/api/v1/admin/search/{id}" + class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" + > + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: red;" + > + DELETE + </div> + <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> + <div dir="rtl" + class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/admin/search/{id}</div> + </div> + + <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" + style="background-color: darkred" + >requires authentication + </div> + </div> + </div> + + + </div> + <div class="sl-flex"> + <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> + <div class="sl-stack sl-stack--vertical sl-stack--10 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--8 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose"> + Headers + </h3> + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Authorization</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + Bearer {YOUR_API_TOKEN} + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + JWT eyJ0eXAiOiJKV... + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">URL Parameters</h3> + + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">id</div> + <span class="sl-truncate sl-text-muted">string</span> + </div> + <div class="sl-flex-1 sl-h-px sl-mx-3"></div> + <span class="sl-ml-2 sl-text-warning">required</span> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>The ID of the search.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + est + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + + + </div> + </div> + </div> + + <div data-testid="two-column-right" class="sl-relative sl-w-2/5 sl-ml-16" style="max-width: 500px;"> + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-h-lg"> + <div class="sl--ml-2"> + Example request: + <select class="example-request-lang-toggle sl-text-base" + aria-label="Request Sample Language" + onchange="switchExampleLanguage(event.target.value);"> + <option>bash</option> + <option>javascript</option> + <option>php</option> + <option>python</option> + </select> + </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-bash" + style=""> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-bash">curl --request DELETE \ + "https://vine.openfoodnetwork.org.au/api/v1/admin/search/est" \ + --header "Authorization: Bearer {YOUR_API_TOKEN}" \ + --header "Content-Type: application/json" \ + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..."</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-javascript" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-javascript">const url = new URL( + "https://vine.openfoodnetwork.org.au/api/v1/admin/search/est" +); + +const headers = { + "Authorization": "Bearer {YOUR_API_TOKEN}", + "Content-Type": "application/json", + "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", +}; + +fetch(url, { + method: "DELETE", + headers, +}).then(response => response.json());</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-php" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-php">$client = new \GuzzleHttp\Client(); +$url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/search/est'; +$response = $client->delete( + $url, + [ + 'headers' => [ + 'Authorization' => 'Bearer {YOUR_API_TOKEN}', + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', + ], + ] +); +$body = $response->getBody(); +print_r(json_decode((string) $body));</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-python" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-python">import requests +import json + +url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/search/est' +headers = { + 'Authorization': 'Bearer {YOUR_API_TOKEN}', + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' +} + +response = requests.request('DELETE', url, headers=headers) +response.json()</code></pre> </div> + </div> + </div> + </div> + + </div> + </div> +</div> + + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-relative"> + <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> + <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" + id="endpoints-GETapi-v1-admin-system-statistics"> + GET / + </h2> + </div> + </div> + + <div class="sl-relative"> + <div title="https://vine.openfoodnetwork.org.au/api/v1/admin/system-statistics" + class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" + > + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: green;" + > + GET + </div> + <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> + <div dir="rtl" + class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/admin/system-statistics</div> + </div> + + <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" + style="background-color: darkred" + >requires authentication + </div> + </div> + </div> + + + </div> + <div class="sl-flex"> + <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> + <div class="sl-stack sl-stack--vertical sl-stack--10 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--8 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose"> + Headers + </h3> + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Authorization</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + Bearer {YOUR_API_TOKEN} + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + JWT eyJ0eXAiOiJKV... + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + + + + </div> + </div> + </div> + + <div data-testid="two-column-right" class="sl-relative sl-w-2/5 sl-ml-16" style="max-width: 500px;"> + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-h-lg"> + <div class="sl--ml-2"> + Example request: + <select class="example-request-lang-toggle sl-text-base" + aria-label="Request Sample Language" + onchange="switchExampleLanguage(event.target.value);"> + <option>bash</option> + <option>javascript</option> + <option>php</option> + <option>python</option> + </select> + </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-bash" + style=""> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-bash">curl --request GET \ + --get "https://vine.openfoodnetwork.org.au/api/v1/admin/system-statistics" \ + --header "Authorization: Bearer {YOUR_API_TOKEN}" \ + --header "Content-Type: application/json" \ + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..."</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-javascript" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-javascript">const url = new URL( + "https://vine.openfoodnetwork.org.au/api/v1/admin/system-statistics" +); + +const headers = { + "Authorization": "Bearer {YOUR_API_TOKEN}", + "Content-Type": "application/json", + "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", +}; + +fetch(url, { + method: "GET", + headers, +}).then(response => response.json());</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-php" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-php">$client = new \GuzzleHttp\Client(); +$url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/system-statistics'; +$response = $client->get( + $url, + [ + 'headers' => [ + 'Authorization' => 'Bearer {YOUR_API_TOKEN}', + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', + ], + ] +); +$body = $response->getBody(); +print_r(json_decode((string) $body));</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-python" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-python">import requests +import json + +url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/system-statistics' +headers = { + 'Authorization': 'Bearer {YOUR_API_TOKEN}', + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' +} + +response = requests.request('GET', url, headers=headers) +response.json()</code></pre> </div> + </div> + </div> + </div> + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-py-2"> + <div class="sl--ml-2"> + <div class="sl-h-sm sl-text-base sl-font-medium sl-px-1.5 sl-text-muted sl-rounded sl-border-transparent sl-border"> + <div class="sl-mb-2 sl-inline-block">Example response:</div> + <div class="sl-mb-2 sl-inline-block"> + <select + class="example-response-GETapi-v1-admin-system-statistics-toggle sl-text-base" + aria-label="Response sample" + onchange="switchExampleResponse('GETapi-v1-admin-system-statistics', event.target.value);"> + <option value="0">401</option> + </select></div> + </div> + </div> + </div> + <button type="button" + class="sl-button sl-h-sm sl-text-base sl-font-medium sl-px-1.5 hover:sl-bg-canvas-50 active:sl-bg-canvas-100 sl-text-muted hover:sl-text-body focus:sl-text-body sl-rounded sl-border-transparent sl-border disabled:sl-opacity-70"> + <div class="sl-mx-0"> + <svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="copy" + class="svg-inline--fa fa-copy fa-fw fa-sm sl-icon" role="img" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"> + <path fill="currentColor" + d="M384 96L384 0h-112c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48H464c26.51 0 48-21.49 48-48V128h-95.1C398.4 128 384 113.6 384 96zM416 0v96h96L416 0zM192 352V128h-144c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h192c26.51 0 48-21.49 48-48L288 416h-32C220.7 416 192 387.3 192 352z"></path> + </svg> + </div> + </button> + </div> + <div class="sl-panel__content-wrapper sl-bg-canvas-100 example-response-GETapi-v1-admin-system-statistics example-response-GETapi-v1-admin-system-statistics-0" + style=" " + > + <div class="sl-panel__content sl-p-0"> <details class="sl-pl-2"> + <summary style="cursor: pointer; list-style: none;"> + <small> + <span class="expansion-chevrons"> + + <svg aria-hidden="true" focusable="false" data-prefix="fas" + data-icon="chevron-right" + class="svg-inline--fa fa-chevron-right fa-fw sl-icon sl-text-muted" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"> + <path fill="currentColor" + d="M96 480c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L242.8 256L73.38 86.63c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l192 192c12.5 12.5 12.5 32.75 0 45.25l-192 192C112.4 476.9 104.2 480 96 480z"></path> + </svg> + </span> + Headers + </small> + </summary> + <pre><code class="language-http"> cache-control + : no-cache, private + content-type + : application/json + access-control-allow-origin + : * + </code></pre> + </details> + + <pre><code style="max-height: 300px;" + class="language-json sl-overflow-x-auto sl-overflow-y-auto">{ + "message": "Unauthenticated." +}</code></pre> + </div> + </div> + </div> + </div> + </div> +</div> + + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-relative"> + <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> + <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" + id="endpoints-POSTapi-v1-admin-system-statistics"> + POST / + </h2> + </div> + </div> + + <div class="sl-relative"> + <div title="https://vine.openfoodnetwork.org.au/api/v1/admin/system-statistics" + class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" + > + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: black;" + > + POST + </div> + <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> + <div dir="rtl" + class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/admin/system-statistics</div> + </div> + + <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" + style="background-color: darkred" + >requires authentication + </div> + </div> + </div> + + + </div> + <div class="sl-flex"> + <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> + <div class="sl-stack sl-stack--vertical sl-stack--10 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--8 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose"> + Headers + </h3> + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Authorization</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + Bearer {YOUR_API_TOKEN} + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + JWT eyJ0eXAiOiJKV... + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + + + + </div> + </div> + </div> + + <div data-testid="two-column-right" class="sl-relative sl-w-2/5 sl-ml-16" style="max-width: 500px;"> + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-h-lg"> + <div class="sl--ml-2"> + Example request: + <select class="example-request-lang-toggle sl-text-base" + aria-label="Request Sample Language" + onchange="switchExampleLanguage(event.target.value);"> + <option>bash</option> + <option>javascript</option> + <option>php</option> + <option>python</option> + </select> + </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-bash" + style=""> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-bash">curl --request POST \ + "https://vine.openfoodnetwork.org.au/api/v1/admin/system-statistics" \ + --header "Authorization: Bearer {YOUR_API_TOKEN}" \ + --header "Content-Type: application/json" \ + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..."</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-javascript" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-javascript">const url = new URL( + "https://vine.openfoodnetwork.org.au/api/v1/admin/system-statistics" +); + +const headers = { + "Authorization": "Bearer {YOUR_API_TOKEN}", + "Content-Type": "application/json", + "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", +}; + +fetch(url, { + method: "POST", + headers, +}).then(response => response.json());</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-php" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-php">$client = new \GuzzleHttp\Client(); +$url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/system-statistics'; +$response = $client->post( + $url, + [ + 'headers' => [ + 'Authorization' => 'Bearer {YOUR_API_TOKEN}', + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', + ], + ] +); +$body = $response->getBody(); +print_r(json_decode((string) $body));</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-python" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-python">import requests +import json + +url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/system-statistics' +headers = { + 'Authorization': 'Bearer {YOUR_API_TOKEN}', + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' +} + +response = requests.request('POST', url, headers=headers) +response.json()</code></pre> </div> + </div> + </div> + </div> + + </div> + </div> +</div> + + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-relative"> + <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> + <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" + id="endpoints-GETapi-v1-admin-system-statistics--id-"> + GET /{id} + </h2> + </div> + </div> + + <div class="sl-relative"> + <div title="https://vine.openfoodnetwork.org.au/api/v1/admin/system-statistics/{id}" + class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" + > + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: green;" + > + GET + </div> + <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> + <div dir="rtl" + class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/admin/system-statistics/{id}</div> + </div> + + <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" + style="background-color: darkred" + >requires authentication + </div> + </div> + </div> + + + </div> + <div class="sl-flex"> + <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> + <div class="sl-stack sl-stack--vertical sl-stack--10 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--8 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose"> + Headers + </h3> + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Authorization</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + Bearer {YOUR_API_TOKEN} + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + JWT eyJ0eXAiOiJKV... + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">URL Parameters</h3> + + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">id</div> + <span class="sl-truncate sl-text-muted">string</span> + </div> + <div class="sl-flex-1 sl-h-px sl-mx-3"></div> + <span class="sl-ml-2 sl-text-warning">required</span> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>The ID of the system statistic.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + vel + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + + + </div> + </div> + </div> + + <div data-testid="two-column-right" class="sl-relative sl-w-2/5 sl-ml-16" style="max-width: 500px;"> + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-h-lg"> + <div class="sl--ml-2"> + Example request: + <select class="example-request-lang-toggle sl-text-base" + aria-label="Request Sample Language" + onchange="switchExampleLanguage(event.target.value);"> + <option>bash</option> + <option>javascript</option> + <option>php</option> + <option>python</option> + </select> + </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-bash" + style=""> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-bash">curl --request GET \ + --get "https://vine.openfoodnetwork.org.au/api/v1/admin/system-statistics/vel" \ + --header "Authorization: Bearer {YOUR_API_TOKEN}" \ + --header "Content-Type: application/json" \ + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..."</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-javascript" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-javascript">const url = new URL( + "https://vine.openfoodnetwork.org.au/api/v1/admin/system-statistics/vel" +); + +const headers = { + "Authorization": "Bearer {YOUR_API_TOKEN}", + "Content-Type": "application/json", + "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", +}; + +fetch(url, { + method: "GET", + headers, +}).then(response => response.json());</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-php" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-php">$client = new \GuzzleHttp\Client(); +$url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/system-statistics/vel'; +$response = $client->get( + $url, + [ + 'headers' => [ + 'Authorization' => 'Bearer {YOUR_API_TOKEN}', + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', + ], + ] +); +$body = $response->getBody(); +print_r(json_decode((string) $body));</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-python" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-python">import requests +import json + +url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/system-statistics/vel' +headers = { + 'Authorization': 'Bearer {YOUR_API_TOKEN}', + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' +} + +response = requests.request('GET', url, headers=headers) +response.json()</code></pre> </div> + </div> + </div> + </div> + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-py-2"> + <div class="sl--ml-2"> + <div class="sl-h-sm sl-text-base sl-font-medium sl-px-1.5 sl-text-muted sl-rounded sl-border-transparent sl-border"> + <div class="sl-mb-2 sl-inline-block">Example response:</div> + <div class="sl-mb-2 sl-inline-block"> + <select + class="example-response-GETapi-v1-admin-system-statistics--id--toggle sl-text-base" + aria-label="Response sample" + onchange="switchExampleResponse('GETapi-v1-admin-system-statistics--id-', event.target.value);"> + <option value="0">401</option> + </select></div> + </div> + </div> + </div> + <button type="button" + class="sl-button sl-h-sm sl-text-base sl-font-medium sl-px-1.5 hover:sl-bg-canvas-50 active:sl-bg-canvas-100 sl-text-muted hover:sl-text-body focus:sl-text-body sl-rounded sl-border-transparent sl-border disabled:sl-opacity-70"> + <div class="sl-mx-0"> + <svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="copy" + class="svg-inline--fa fa-copy fa-fw fa-sm sl-icon" role="img" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"> + <path fill="currentColor" + d="M384 96L384 0h-112c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48H464c26.51 0 48-21.49 48-48V128h-95.1C398.4 128 384 113.6 384 96zM416 0v96h96L416 0zM192 352V128h-144c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h192c26.51 0 48-21.49 48-48L288 416h-32C220.7 416 192 387.3 192 352z"></path> + </svg> + </div> + </button> + </div> + <div class="sl-panel__content-wrapper sl-bg-canvas-100 example-response-GETapi-v1-admin-system-statistics--id- example-response-GETapi-v1-admin-system-statistics--id--0" + style=" " + > + <div class="sl-panel__content sl-p-0"> <details class="sl-pl-2"> + <summary style="cursor: pointer; list-style: none;"> + <small> + <span class="expansion-chevrons"> + + <svg aria-hidden="true" focusable="false" data-prefix="fas" + data-icon="chevron-right" + class="svg-inline--fa fa-chevron-right fa-fw sl-icon sl-text-muted" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"> + <path fill="currentColor" + d="M96 480c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L242.8 256L73.38 86.63c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l192 192c12.5 12.5 12.5 32.75 0 45.25l-192 192C112.4 476.9 104.2 480 96 480z"></path> + </svg> + </span> + Headers + </small> + </summary> + <pre><code class="language-http"> cache-control + : no-cache, private + content-type + : application/json + access-control-allow-origin + : * + </code></pre> + </details> + + <pre><code style="max-height: 300px;" + class="language-json sl-overflow-x-auto sl-overflow-y-auto">{ + "message": "Unauthenticated." +}</code></pre> + </div> + </div> + </div> + </div> + </div> +</div> + + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-relative"> + <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> + <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" + id="endpoints-PUTapi-v1-admin-system-statistics--id-"> + PUT /{id} + </h2> + </div> + </div> + + <div class="sl-relative"> + <div title="https://vine.openfoodnetwork.org.au/api/v1/admin/system-statistics/{id}" + class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" + > + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: darkblue;" + > + PUT + </div> + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: purple;" + > + PATCH + </div> + <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> + <div dir="rtl" + class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/admin/system-statistics/{id}</div> + </div> + + <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" + style="background-color: darkred" + >requires authentication + </div> + </div> + </div> + + + </div> + <div class="sl-flex"> + <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> + <div class="sl-stack sl-stack--vertical sl-stack--10 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--8 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose"> + Headers + </h3> + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Authorization</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + Bearer {YOUR_API_TOKEN} + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + JWT eyJ0eXAiOiJKV... + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">URL Parameters</h3> + + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">id</div> + <span class="sl-truncate sl-text-muted">string</span> + </div> + <div class="sl-flex-1 sl-h-px sl-mx-3"></div> + <span class="sl-ml-2 sl-text-warning">required</span> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>The ID of the system statistic.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + molestiae + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + + + </div> + </div> + </div> + + <div data-testid="two-column-right" class="sl-relative sl-w-2/5 sl-ml-16" style="max-width: 500px;"> + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-h-lg"> + <div class="sl--ml-2"> + Example request: + <select class="example-request-lang-toggle sl-text-base" + aria-label="Request Sample Language" + onchange="switchExampleLanguage(event.target.value);"> + <option>bash</option> + <option>javascript</option> + <option>php</option> + <option>python</option> + </select> + </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-bash" + style=""> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-bash">curl --request PUT \ + "https://vine.openfoodnetwork.org.au/api/v1/admin/system-statistics/molestiae" \ + --header "Authorization: Bearer {YOUR_API_TOKEN}" \ + --header "Content-Type: application/json" \ + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..."</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-javascript" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-javascript">const url = new URL( + "https://vine.openfoodnetwork.org.au/api/v1/admin/system-statistics/molestiae" +); + +const headers = { + "Authorization": "Bearer {YOUR_API_TOKEN}", + "Content-Type": "application/json", + "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", +}; + +fetch(url, { + method: "PUT", + headers, +}).then(response => response.json());</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-php" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-php">$client = new \GuzzleHttp\Client(); +$url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/system-statistics/molestiae'; +$response = $client->put( + $url, + [ + 'headers' => [ + 'Authorization' => 'Bearer {YOUR_API_TOKEN}', + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', + ], + ] +); +$body = $response->getBody(); +print_r(json_decode((string) $body));</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-python" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-python">import requests +import json + +url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/system-statistics/molestiae' +headers = { + 'Authorization': 'Bearer {YOUR_API_TOKEN}', + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' +} + +response = requests.request('PUT', url, headers=headers) +response.json()</code></pre> </div> + </div> + </div> + </div> + + </div> + </div> +</div> + + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-relative"> + <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> + <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" + id="endpoints-DELETEapi-v1-admin-system-statistics--id-"> + DELETE / {id} + </h2> + </div> + </div> + + <div class="sl-relative"> + <div title="https://vine.openfoodnetwork.org.au/api/v1/admin/system-statistics/{id}" + class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" + > + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: red;" + > + DELETE + </div> + <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> + <div dir="rtl" + class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/admin/system-statistics/{id}</div> + </div> + + <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" + style="background-color: darkred" + >requires authentication + </div> + </div> + </div> + + + </div> + <div class="sl-flex"> + <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> + <div class="sl-stack sl-stack--vertical sl-stack--10 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--8 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose"> + Headers + </h3> + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Authorization</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + Bearer {YOUR_API_TOKEN} + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + JWT eyJ0eXAiOiJKV... + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">URL Parameters</h3> + + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">id</div> + <span class="sl-truncate sl-text-muted">string</span> + </div> + <div class="sl-flex-1 sl-h-px sl-mx-3"></div> + <span class="sl-ml-2 sl-text-warning">required</span> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>The ID of the system statistic.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + sit + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + + + </div> + </div> + </div> + + <div data-testid="two-column-right" class="sl-relative sl-w-2/5 sl-ml-16" style="max-width: 500px;"> + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-h-lg"> + <div class="sl--ml-2"> + Example request: + <select class="example-request-lang-toggle sl-text-base" + aria-label="Request Sample Language" + onchange="switchExampleLanguage(event.target.value);"> + <option>bash</option> + <option>javascript</option> + <option>php</option> + <option>python</option> + </select> + </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-bash" + style=""> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-bash">curl --request DELETE \ + "https://vine.openfoodnetwork.org.au/api/v1/admin/system-statistics/sit" \ + --header "Authorization: Bearer {YOUR_API_TOKEN}" \ + --header "Content-Type: application/json" \ + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..."</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-javascript" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-javascript">const url = new URL( + "https://vine.openfoodnetwork.org.au/api/v1/admin/system-statistics/sit" +); + +const headers = { + "Authorization": "Bearer {YOUR_API_TOKEN}", + "Content-Type": "application/json", + "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", +}; + +fetch(url, { + method: "DELETE", + headers, +}).then(response => response.json());</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-php" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-php">$client = new \GuzzleHttp\Client(); +$url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/system-statistics/sit'; +$response = $client->delete( + $url, + [ + 'headers' => [ + 'Authorization' => 'Bearer {YOUR_API_TOKEN}', + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', + ], + ] +); +$body = $response->getBody(); +print_r(json_decode((string) $body));</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-python" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-python">import requests +import json + +url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/system-statistics/sit' +headers = { + 'Authorization': 'Bearer {YOUR_API_TOKEN}', + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' +} + +response = requests.request('DELETE', url, headers=headers) +response.json()</code></pre> </div> + </div> + </div> + </div> + + </div> + </div> +</div> + + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-relative"> + <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> + <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" + id="endpoints-GETapi-v1-admin-team-merchant-teams"> + GET / + </h2> + </div> + </div> + + <div class="sl-relative"> + <div title="https://vine.openfoodnetwork.org.au/api/v1/admin/team-merchant-teams" + class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" + > + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: green;" + > + GET + </div> + <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> + <div dir="rtl" + class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/admin/team-merchant-teams</div> + </div> + + <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" + style="background-color: darkred" + >requires authentication + </div> + </div> + </div> + + + </div> + <div class="sl-flex"> + <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> + <div class="sl-stack sl-stack--vertical sl-stack--10 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--8 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose"> + Headers + </h3> + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Authorization</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + Bearer {YOUR_API_TOKEN} + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + JWT eyJ0eXAiOiJKV... + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + + + + </div> + </div> + </div> + + <div data-testid="two-column-right" class="sl-relative sl-w-2/5 sl-ml-16" style="max-width: 500px;"> + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-h-lg"> + <div class="sl--ml-2"> + Example request: + <select class="example-request-lang-toggle sl-text-base" + aria-label="Request Sample Language" + onchange="switchExampleLanguage(event.target.value);"> + <option>bash</option> + <option>javascript</option> + <option>php</option> + <option>python</option> + </select> + </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-bash" + style=""> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-bash">curl --request GET \ + --get "https://vine.openfoodnetwork.org.au/api/v1/admin/team-merchant-teams" \ + --header "Authorization: Bearer {YOUR_API_TOKEN}" \ + --header "Content-Type: application/json" \ + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..."</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-javascript" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-javascript">const url = new URL( + "https://vine.openfoodnetwork.org.au/api/v1/admin/team-merchant-teams" +); + +const headers = { + "Authorization": "Bearer {YOUR_API_TOKEN}", + "Content-Type": "application/json", + "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", +}; + +fetch(url, { + method: "GET", + headers, +}).then(response => response.json());</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-php" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-php">$client = new \GuzzleHttp\Client(); +$url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/team-merchant-teams'; +$response = $client->get( + $url, + [ + 'headers' => [ + 'Authorization' => 'Bearer {YOUR_API_TOKEN}', + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', + ], + ] +); +$body = $response->getBody(); +print_r(json_decode((string) $body));</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-python" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-python">import requests +import json + +url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/team-merchant-teams' +headers = { + 'Authorization': 'Bearer {YOUR_API_TOKEN}', + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' +} + +response = requests.request('GET', url, headers=headers) +response.json()</code></pre> </div> + </div> + </div> + </div> + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-py-2"> + <div class="sl--ml-2"> + <div class="sl-h-sm sl-text-base sl-font-medium sl-px-1.5 sl-text-muted sl-rounded sl-border-transparent sl-border"> + <div class="sl-mb-2 sl-inline-block">Example response:</div> + <div class="sl-mb-2 sl-inline-block"> + <select + class="example-response-GETapi-v1-admin-team-merchant-teams-toggle sl-text-base" + aria-label="Response sample" + onchange="switchExampleResponse('GETapi-v1-admin-team-merchant-teams', event.target.value);"> + <option value="0">401</option> + </select></div> + </div> + </div> + </div> + <button type="button" + class="sl-button sl-h-sm sl-text-base sl-font-medium sl-px-1.5 hover:sl-bg-canvas-50 active:sl-bg-canvas-100 sl-text-muted hover:sl-text-body focus:sl-text-body sl-rounded sl-border-transparent sl-border disabled:sl-opacity-70"> + <div class="sl-mx-0"> + <svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="copy" + class="svg-inline--fa fa-copy fa-fw fa-sm sl-icon" role="img" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"> + <path fill="currentColor" + d="M384 96L384 0h-112c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48H464c26.51 0 48-21.49 48-48V128h-95.1C398.4 128 384 113.6 384 96zM416 0v96h96L416 0zM192 352V128h-144c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h192c26.51 0 48-21.49 48-48L288 416h-32C220.7 416 192 387.3 192 352z"></path> + </svg> + </div> + </button> + </div> + <div class="sl-panel__content-wrapper sl-bg-canvas-100 example-response-GETapi-v1-admin-team-merchant-teams example-response-GETapi-v1-admin-team-merchant-teams-0" + style=" " + > + <div class="sl-panel__content sl-p-0"> <details class="sl-pl-2"> + <summary style="cursor: pointer; list-style: none;"> + <small> + <span class="expansion-chevrons"> + + <svg aria-hidden="true" focusable="false" data-prefix="fas" + data-icon="chevron-right" + class="svg-inline--fa fa-chevron-right fa-fw sl-icon sl-text-muted" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"> + <path fill="currentColor" + d="M96 480c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L242.8 256L73.38 86.63c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l192 192c12.5 12.5 12.5 32.75 0 45.25l-192 192C112.4 476.9 104.2 480 96 480z"></path> + </svg> + </span> + Headers + </small> + </summary> + <pre><code class="language-http"> cache-control + : no-cache, private + content-type + : application/json + access-control-allow-origin + : * + </code></pre> + </details> + + <pre><code style="max-height: 300px;" + class="language-json sl-overflow-x-auto sl-overflow-y-auto">{ + "message": "Unauthenticated." +}</code></pre> + </div> + </div> + </div> + </div> + </div> +</div> + + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-relative"> + <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> + <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" + id="endpoints-POSTapi-v1-admin-team-merchant-teams"> + POST / + </h2> + </div> + </div> + + <div class="sl-relative"> + <div title="https://vine.openfoodnetwork.org.au/api/v1/admin/team-merchant-teams" + class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" + > + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: black;" + > + POST + </div> + <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> + <div dir="rtl" + class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/admin/team-merchant-teams</div> + </div> + + <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" + style="background-color: darkred" + >requires authentication + </div> + </div> + </div> + + + </div> + <div class="sl-flex"> + <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> + <div class="sl-stack sl-stack--vertical sl-stack--10 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--8 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose"> + Headers + </h3> + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Authorization</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + Bearer {YOUR_API_TOKEN} + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + JWT eyJ0eXAiOiJKV... + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + + + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">Body Parameters</h3> + + <div class="sl-text-sm"> + <div class="expandable sl-text-sm sl-border-l sl-ml-px"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">team_id</div> + <span class="sl-truncate sl-text-muted">string</span> + </div> + <div class="sl-flex-1 sl-h-px sl-mx-3"></div> + <span class="sl-ml-2 sl-text-warning">required</span> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + cum + </div> + </div> + </div> + </div> +</div> + + </div> + <div class="expandable sl-text-sm sl-border-l sl-ml-px"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">merchant_team_id</div> + <span class="sl-truncate sl-text-muted">string</span> + </div> + <div class="sl-flex-1 sl-h-px sl-mx-3"></div> + <span class="sl-ml-2 sl-text-warning">required</span> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + nulla + </div> + </div> + </div> + </div> +</div> + + </div> + </div> + </div> + + </div> + </div> + </div> + + <div data-testid="two-column-right" class="sl-relative sl-w-2/5 sl-ml-16" style="max-width: 500px;"> + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-h-lg"> + <div class="sl--ml-2"> + Example request: + <select class="example-request-lang-toggle sl-text-base" + aria-label="Request Sample Language" + onchange="switchExampleLanguage(event.target.value);"> + <option>bash</option> + <option>javascript</option> + <option>php</option> + <option>python</option> + </select> + </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-bash" + style=""> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-bash">curl --request POST \ + "https://vine.openfoodnetwork.org.au/api/v1/admin/team-merchant-teams" \ + --header "Authorization: Bearer {YOUR_API_TOKEN}" \ + --header "Content-Type: application/json" \ + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..." \ + --data "{ + \"team_id\": \"cum\", + \"merchant_team_id\": \"nulla\" +}" +</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-javascript" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-javascript">const url = new URL( + "https://vine.openfoodnetwork.org.au/api/v1/admin/team-merchant-teams" +); + +const headers = { + "Authorization": "Bearer {YOUR_API_TOKEN}", + "Content-Type": "application/json", + "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", +}; + +let body = { + "team_id": "cum", + "merchant_team_id": "nulla" +}; + +fetch(url, { + method: "POST", + headers, + body: JSON.stringify(body), +}).then(response => response.json());</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-php" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-php">$client = new \GuzzleHttp\Client(); +$url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/team-merchant-teams'; +$response = $client->post( + $url, + [ + 'headers' => [ + 'Authorization' => 'Bearer {YOUR_API_TOKEN}', + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', + ], + 'json' => [ + 'team_id' => 'cum', + 'merchant_team_id' => 'nulla', + ], + ] +); +$body = $response->getBody(); +print_r(json_decode((string) $body));</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-python" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-python">import requests +import json + +url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/team-merchant-teams' +payload = { + "team_id": "cum", + "merchant_team_id": "nulla" +} +headers = { + 'Authorization': 'Bearer {YOUR_API_TOKEN}', + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' +} + +response = requests.request('POST', url, headers=headers, json=payload) +response.json()</code></pre> </div> + </div> + </div> + </div> + + </div> + </div> +</div> + + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-relative"> + <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> + <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" + id="endpoints-GETapi-v1-admin-team-merchant-teams--id-"> + GET /{id} + </h2> + </div> + </div> + + <div class="sl-relative"> + <div title="https://vine.openfoodnetwork.org.au/api/v1/admin/team-merchant-teams/{id}" + class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" + > + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: green;" + > + GET + </div> + <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> + <div dir="rtl" + class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/admin/team-merchant-teams/{id}</div> + </div> + + <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" + style="background-color: darkred" + >requires authentication + </div> + </div> + </div> + + + </div> + <div class="sl-flex"> + <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> + <div class="sl-stack sl-stack--vertical sl-stack--10 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--8 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose"> + Headers + </h3> + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Authorization</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + Bearer {YOUR_API_TOKEN} + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + JWT eyJ0eXAiOiJKV... + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">URL Parameters</h3> + + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">id</div> + <span class="sl-truncate sl-text-muted">string</span> + </div> + <div class="sl-flex-1 sl-h-px sl-mx-3"></div> + <span class="sl-ml-2 sl-text-warning">required</span> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>The ID of the team merchant team.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + maxime + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + + + </div> + </div> + </div> + + <div data-testid="two-column-right" class="sl-relative sl-w-2/5 sl-ml-16" style="max-width: 500px;"> + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-h-lg"> + <div class="sl--ml-2"> + Example request: + <select class="example-request-lang-toggle sl-text-base" + aria-label="Request Sample Language" + onchange="switchExampleLanguage(event.target.value);"> + <option>bash</option> + <option>javascript</option> + <option>php</option> + <option>python</option> + </select> + </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-bash" + style=""> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-bash">curl --request GET \ + --get "https://vine.openfoodnetwork.org.au/api/v1/admin/team-merchant-teams/maxime" \ + --header "Authorization: Bearer {YOUR_API_TOKEN}" \ + --header "Content-Type: application/json" \ + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..."</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-javascript" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-javascript">const url = new URL( + "https://vine.openfoodnetwork.org.au/api/v1/admin/team-merchant-teams/maxime" +); + +const headers = { + "Authorization": "Bearer {YOUR_API_TOKEN}", + "Content-Type": "application/json", + "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", +}; + +fetch(url, { + method: "GET", + headers, +}).then(response => response.json());</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-php" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-php">$client = new \GuzzleHttp\Client(); +$url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/team-merchant-teams/maxime'; +$response = $client->get( + $url, + [ + 'headers' => [ + 'Authorization' => 'Bearer {YOUR_API_TOKEN}', + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', + ], + ] +); +$body = $response->getBody(); +print_r(json_decode((string) $body));</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-python" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-python">import requests +import json + +url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/team-merchant-teams/maxime' +headers = { + 'Authorization': 'Bearer {YOUR_API_TOKEN}', + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' +} + +response = requests.request('GET', url, headers=headers) +response.json()</code></pre> </div> + </div> + </div> + </div> + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-py-2"> + <div class="sl--ml-2"> + <div class="sl-h-sm sl-text-base sl-font-medium sl-px-1.5 sl-text-muted sl-rounded sl-border-transparent sl-border"> + <div class="sl-mb-2 sl-inline-block">Example response:</div> + <div class="sl-mb-2 sl-inline-block"> + <select + class="example-response-GETapi-v1-admin-team-merchant-teams--id--toggle sl-text-base" + aria-label="Response sample" + onchange="switchExampleResponse('GETapi-v1-admin-team-merchant-teams--id-', event.target.value);"> + <option value="0">401</option> + </select></div> + </div> + </div> + </div> + <button type="button" + class="sl-button sl-h-sm sl-text-base sl-font-medium sl-px-1.5 hover:sl-bg-canvas-50 active:sl-bg-canvas-100 sl-text-muted hover:sl-text-body focus:sl-text-body sl-rounded sl-border-transparent sl-border disabled:sl-opacity-70"> + <div class="sl-mx-0"> + <svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="copy" + class="svg-inline--fa fa-copy fa-fw fa-sm sl-icon" role="img" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"> + <path fill="currentColor" + d="M384 96L384 0h-112c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48H464c26.51 0 48-21.49 48-48V128h-95.1C398.4 128 384 113.6 384 96zM416 0v96h96L416 0zM192 352V128h-144c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h192c26.51 0 48-21.49 48-48L288 416h-32C220.7 416 192 387.3 192 352z"></path> + </svg> + </div> + </button> + </div> + <div class="sl-panel__content-wrapper sl-bg-canvas-100 example-response-GETapi-v1-admin-team-merchant-teams--id- example-response-GETapi-v1-admin-team-merchant-teams--id--0" + style=" " + > + <div class="sl-panel__content sl-p-0"> <details class="sl-pl-2"> + <summary style="cursor: pointer; list-style: none;"> + <small> + <span class="expansion-chevrons"> + + <svg aria-hidden="true" focusable="false" data-prefix="fas" + data-icon="chevron-right" + class="svg-inline--fa fa-chevron-right fa-fw sl-icon sl-text-muted" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"> + <path fill="currentColor" + d="M96 480c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L242.8 256L73.38 86.63c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l192 192c12.5 12.5 12.5 32.75 0 45.25l-192 192C112.4 476.9 104.2 480 96 480z"></path> + </svg> + </span> + Headers + </small> + </summary> + <pre><code class="language-http"> cache-control + : no-cache, private + content-type + : application/json + access-control-allow-origin + : * + </code></pre> + </details> + + <pre><code style="max-height: 300px;" + class="language-json sl-overflow-x-auto sl-overflow-y-auto">{ + "message": "Unauthenticated." +}</code></pre> + </div> + </div> + </div> + </div> + </div> +</div> + + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-relative"> + <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> + <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" + id="endpoints-PUTapi-v1-admin-team-merchant-teams--id-"> + PUT /{id} + </h2> + </div> + </div> + + <div class="sl-relative"> + <div title="https://vine.openfoodnetwork.org.au/api/v1/admin/team-merchant-teams/{id}" + class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" + > + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: darkblue;" + > + PUT + </div> + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: purple;" + > + PATCH + </div> + <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> + <div dir="rtl" + class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/admin/team-merchant-teams/{id}</div> + </div> + + <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" + style="background-color: darkred" + >requires authentication + </div> + </div> + </div> + + + </div> + <div class="sl-flex"> + <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> + <div class="sl-stack sl-stack--vertical sl-stack--10 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--8 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose"> + Headers + </h3> + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Authorization</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + Bearer {YOUR_API_TOKEN} + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + JWT eyJ0eXAiOiJKV... + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">URL Parameters</h3> + + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">id</div> + <span class="sl-truncate sl-text-muted">string</span> + </div> + <div class="sl-flex-1 sl-h-px sl-mx-3"></div> + <span class="sl-ml-2 sl-text-warning">required</span> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>The ID of the team merchant team.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + sit + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + + + </div> + </div> + </div> + + <div data-testid="two-column-right" class="sl-relative sl-w-2/5 sl-ml-16" style="max-width: 500px;"> + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-h-lg"> + <div class="sl--ml-2"> + Example request: + <select class="example-request-lang-toggle sl-text-base" + aria-label="Request Sample Language" + onchange="switchExampleLanguage(event.target.value);"> + <option>bash</option> + <option>javascript</option> + <option>php</option> + <option>python</option> + </select> + </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-bash" + style=""> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-bash">curl --request PUT \ + "https://vine.openfoodnetwork.org.au/api/v1/admin/team-merchant-teams/sit" \ + --header "Authorization: Bearer {YOUR_API_TOKEN}" \ + --header "Content-Type: application/json" \ + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..."</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-javascript" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-javascript">const url = new URL( + "https://vine.openfoodnetwork.org.au/api/v1/admin/team-merchant-teams/sit" +); + +const headers = { + "Authorization": "Bearer {YOUR_API_TOKEN}", + "Content-Type": "application/json", + "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", +}; + +fetch(url, { + method: "PUT", + headers, +}).then(response => response.json());</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-php" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-php">$client = new \GuzzleHttp\Client(); +$url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/team-merchant-teams/sit'; +$response = $client->put( + $url, + [ + 'headers' => [ + 'Authorization' => 'Bearer {YOUR_API_TOKEN}', + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', + ], + ] +); +$body = $response->getBody(); +print_r(json_decode((string) $body));</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-python" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-python">import requests +import json + +url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/team-merchant-teams/sit' +headers = { + 'Authorization': 'Bearer {YOUR_API_TOKEN}', + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' +} + +response = requests.request('PUT', url, headers=headers) +response.json()</code></pre> </div> + </div> + </div> + </div> + + </div> + </div> +</div> + + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-relative"> + <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> + <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" + id="endpoints-DELETEapi-v1-admin-team-merchant-teams--id-"> + DELETE /{id} + </h2> + </div> + </div> + + <div class="sl-relative"> + <div title="https://vine.openfoodnetwork.org.au/api/v1/admin/team-merchant-teams/{id}" + class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" + > + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: red;" + > + DELETE + </div> + <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> + <div dir="rtl" + class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/admin/team-merchant-teams/{id}</div> + </div> + + <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" + style="background-color: darkred" + >requires authentication + </div> + </div> + </div> + + + </div> + <div class="sl-flex"> + <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> + <div class="sl-stack sl-stack--vertical sl-stack--10 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--8 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose"> + Headers + </h3> + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Authorization</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + Bearer {YOUR_API_TOKEN} + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + JWT eyJ0eXAiOiJKV... + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">URL Parameters</h3> + + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">id</div> + <span class="sl-truncate sl-text-muted">string</span> + </div> + <div class="sl-flex-1 sl-h-px sl-mx-3"></div> + <span class="sl-ml-2 sl-text-warning">required</span> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>The ID of the team merchant team.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + in + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + + + </div> + </div> + </div> + + <div data-testid="two-column-right" class="sl-relative sl-w-2/5 sl-ml-16" style="max-width: 500px;"> + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-h-lg"> + <div class="sl--ml-2"> + Example request: + <select class="example-request-lang-toggle sl-text-base" + aria-label="Request Sample Language" + onchange="switchExampleLanguage(event.target.value);"> + <option>bash</option> + <option>javascript</option> + <option>php</option> + <option>python</option> + </select> + </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-bash" + style=""> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-bash">curl --request DELETE \ + "https://vine.openfoodnetwork.org.au/api/v1/admin/team-merchant-teams/in" \ + --header "Authorization: Bearer {YOUR_API_TOKEN}" \ + --header "Content-Type: application/json" \ + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..."</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-javascript" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-javascript">const url = new URL( + "https://vine.openfoodnetwork.org.au/api/v1/admin/team-merchant-teams/in" +); + +const headers = { + "Authorization": "Bearer {YOUR_API_TOKEN}", + "Content-Type": "application/json", + "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", +}; + +fetch(url, { + method: "DELETE", + headers, +}).then(response => response.json());</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-php" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-php">$client = new \GuzzleHttp\Client(); +$url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/team-merchant-teams/in'; +$response = $client->delete( + $url, + [ + 'headers' => [ + 'Authorization' => 'Bearer {YOUR_API_TOKEN}', + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', + ], + ] +); +$body = $response->getBody(); +print_r(json_decode((string) $body));</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-python" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-python">import requests +import json + +url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/team-merchant-teams/in' +headers = { + 'Authorization': 'Bearer {YOUR_API_TOKEN}', + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' +} + +response = requests.request('DELETE', url, headers=headers) +response.json()</code></pre> </div> + </div> + </div> + </div> + + </div> + </div> +</div> + + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-relative"> + <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> + <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" + id="endpoints-GETapi-v1-admin-team-service-teams"> + GET / + </h2> + </div> + </div> + + <div class="sl-relative"> + <div title="https://vine.openfoodnetwork.org.au/api/v1/admin/team-service-teams" + class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" + > + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: green;" + > + GET + </div> + <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> + <div dir="rtl" + class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/admin/team-service-teams</div> + </div> + + <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" + style="background-color: darkred" + >requires authentication + </div> + </div> + </div> + + + </div> + <div class="sl-flex"> + <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> + <div class="sl-stack sl-stack--vertical sl-stack--10 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--8 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose"> + Headers + </h3> + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Authorization</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + Bearer {YOUR_API_TOKEN} + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + JWT eyJ0eXAiOiJKV... + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + + + + </div> + </div> + </div> + + <div data-testid="two-column-right" class="sl-relative sl-w-2/5 sl-ml-16" style="max-width: 500px;"> + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-h-lg"> + <div class="sl--ml-2"> + Example request: + <select class="example-request-lang-toggle sl-text-base" + aria-label="Request Sample Language" + onchange="switchExampleLanguage(event.target.value);"> + <option>bash</option> + <option>javascript</option> + <option>php</option> + <option>python</option> + </select> + </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-bash" + style=""> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-bash">curl --request GET \ + --get "https://vine.openfoodnetwork.org.au/api/v1/admin/team-service-teams" \ + --header "Authorization: Bearer {YOUR_API_TOKEN}" \ + --header "Content-Type: application/json" \ + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..."</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-javascript" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-javascript">const url = new URL( + "https://vine.openfoodnetwork.org.au/api/v1/admin/team-service-teams" +); + +const headers = { + "Authorization": "Bearer {YOUR_API_TOKEN}", + "Content-Type": "application/json", + "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", +}; + +fetch(url, { + method: "GET", + headers, +}).then(response => response.json());</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-php" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-php">$client = new \GuzzleHttp\Client(); +$url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/team-service-teams'; +$response = $client->get( + $url, + [ + 'headers' => [ + 'Authorization' => 'Bearer {YOUR_API_TOKEN}', + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', + ], + ] +); +$body = $response->getBody(); +print_r(json_decode((string) $body));</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-python" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-python">import requests +import json + +url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/team-service-teams' +headers = { + 'Authorization': 'Bearer {YOUR_API_TOKEN}', + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' +} + +response = requests.request('GET', url, headers=headers) +response.json()</code></pre> </div> + </div> + </div> + </div> + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-py-2"> + <div class="sl--ml-2"> + <div class="sl-h-sm sl-text-base sl-font-medium sl-px-1.5 sl-text-muted sl-rounded sl-border-transparent sl-border"> + <div class="sl-mb-2 sl-inline-block">Example response:</div> + <div class="sl-mb-2 sl-inline-block"> + <select + class="example-response-GETapi-v1-admin-team-service-teams-toggle sl-text-base" + aria-label="Response sample" + onchange="switchExampleResponse('GETapi-v1-admin-team-service-teams', event.target.value);"> + <option value="0">401</option> + </select></div> + </div> + </div> + </div> + <button type="button" + class="sl-button sl-h-sm sl-text-base sl-font-medium sl-px-1.5 hover:sl-bg-canvas-50 active:sl-bg-canvas-100 sl-text-muted hover:sl-text-body focus:sl-text-body sl-rounded sl-border-transparent sl-border disabled:sl-opacity-70"> + <div class="sl-mx-0"> + <svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="copy" + class="svg-inline--fa fa-copy fa-fw fa-sm sl-icon" role="img" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"> + <path fill="currentColor" + d="M384 96L384 0h-112c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48H464c26.51 0 48-21.49 48-48V128h-95.1C398.4 128 384 113.6 384 96zM416 0v96h96L416 0zM192 352V128h-144c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h192c26.51 0 48-21.49 48-48L288 416h-32C220.7 416 192 387.3 192 352z"></path> + </svg> + </div> + </button> + </div> + <div class="sl-panel__content-wrapper sl-bg-canvas-100 example-response-GETapi-v1-admin-team-service-teams example-response-GETapi-v1-admin-team-service-teams-0" + style=" " + > + <div class="sl-panel__content sl-p-0"> <details class="sl-pl-2"> + <summary style="cursor: pointer; list-style: none;"> + <small> + <span class="expansion-chevrons"> + + <svg aria-hidden="true" focusable="false" data-prefix="fas" + data-icon="chevron-right" + class="svg-inline--fa fa-chevron-right fa-fw sl-icon sl-text-muted" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"> + <path fill="currentColor" + d="M96 480c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L242.8 256L73.38 86.63c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l192 192c12.5 12.5 12.5 32.75 0 45.25l-192 192C112.4 476.9 104.2 480 96 480z"></path> + </svg> + </span> + Headers + </small> + </summary> + <pre><code class="language-http"> cache-control + : no-cache, private + content-type + : application/json + access-control-allow-origin + : * + </code></pre> + </details> + + <pre><code style="max-height: 300px;" + class="language-json sl-overflow-x-auto sl-overflow-y-auto">{ + "message": "Unauthenticated." +}</code></pre> + </div> + </div> + </div> + </div> + </div> +</div> + + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-relative"> + <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> + <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" + id="endpoints-POSTapi-v1-admin-team-service-teams"> + POST / + </h2> + </div> + </div> + + <div class="sl-relative"> + <div title="https://vine.openfoodnetwork.org.au/api/v1/admin/team-service-teams" + class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" + > + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: black;" + > + POST + </div> + <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> + <div dir="rtl" + class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/admin/team-service-teams</div> + </div> + + <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" + style="background-color: darkred" + >requires authentication + </div> + </div> + </div> + + + </div> + <div class="sl-flex"> + <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> + <div class="sl-stack sl-stack--vertical sl-stack--10 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--8 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose"> + Headers + </h3> + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Authorization</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + Bearer {YOUR_API_TOKEN} + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + JWT eyJ0eXAiOiJKV... + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + + + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">Body Parameters</h3> + + <div class="sl-text-sm"> + <div class="expandable sl-text-sm sl-border-l sl-ml-px"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">team_id</div> + <span class="sl-truncate sl-text-muted">string</span> + </div> + <div class="sl-flex-1 sl-h-px sl-mx-3"></div> + <span class="sl-ml-2 sl-text-warning">required</span> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + qui + </div> + </div> + </div> + </div> +</div> + + </div> + <div class="expandable sl-text-sm sl-border-l sl-ml-px"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">service_team_id</div> + <span class="sl-truncate sl-text-muted">string</span> + </div> + <div class="sl-flex-1 sl-h-px sl-mx-3"></div> + <span class="sl-ml-2 sl-text-warning">required</span> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + provident + </div> + </div> + </div> + </div> +</div> + + </div> + </div> + </div> + + </div> + </div> + </div> + + <div data-testid="two-column-right" class="sl-relative sl-w-2/5 sl-ml-16" style="max-width: 500px;"> + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-h-lg"> + <div class="sl--ml-2"> + Example request: + <select class="example-request-lang-toggle sl-text-base" + aria-label="Request Sample Language" + onchange="switchExampleLanguage(event.target.value);"> + <option>bash</option> + <option>javascript</option> + <option>php</option> + <option>python</option> + </select> + </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-bash" + style=""> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-bash">curl --request POST \ + "https://vine.openfoodnetwork.org.au/api/v1/admin/team-service-teams" \ + --header "Authorization: Bearer {YOUR_API_TOKEN}" \ + --header "Content-Type: application/json" \ + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..." \ + --data "{ + \"team_id\": \"qui\", + \"service_team_id\": \"provident\" +}" +</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-javascript" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-javascript">const url = new URL( + "https://vine.openfoodnetwork.org.au/api/v1/admin/team-service-teams" +); + +const headers = { + "Authorization": "Bearer {YOUR_API_TOKEN}", + "Content-Type": "application/json", + "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", +}; + +let body = { + "team_id": "qui", + "service_team_id": "provident" +}; + +fetch(url, { + method: "POST", + headers, + body: JSON.stringify(body), +}).then(response => response.json());</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-php" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-php">$client = new \GuzzleHttp\Client(); +$url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/team-service-teams'; +$response = $client->post( + $url, + [ + 'headers' => [ + 'Authorization' => 'Bearer {YOUR_API_TOKEN}', + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', + ], + 'json' => [ + 'team_id' => 'qui', + 'service_team_id' => 'provident', + ], + ] +); +$body = $response->getBody(); +print_r(json_decode((string) $body));</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-python" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-python">import requests +import json + +url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/team-service-teams' +payload = { + "team_id": "qui", + "service_team_id": "provident" +} +headers = { + 'Authorization': 'Bearer {YOUR_API_TOKEN}', + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' +} + +response = requests.request('POST', url, headers=headers, json=payload) +response.json()</code></pre> </div> + </div> + </div> + </div> + + </div> + </div> +</div> + + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-relative"> + <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> + <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" + id="endpoints-GETapi-v1-admin-team-service-teams--id-"> + GET / {id} + </h2> + </div> + </div> + + <div class="sl-relative"> + <div title="https://vine.openfoodnetwork.org.au/api/v1/admin/team-service-teams/{id}" + class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" + > + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: green;" + > + GET + </div> + <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> + <div dir="rtl" + class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/admin/team-service-teams/{id}</div> + </div> + + <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" + style="background-color: darkred" + >requires authentication + </div> + </div> + </div> + + + </div> + <div class="sl-flex"> + <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> + <div class="sl-stack sl-stack--vertical sl-stack--10 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--8 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose"> + Headers + </h3> + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Authorization</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + Bearer {YOUR_API_TOKEN} + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + JWT eyJ0eXAiOiJKV... + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">URL Parameters</h3> + + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">id</div> + <span class="sl-truncate sl-text-muted">string</span> + </div> + <div class="sl-flex-1 sl-h-px sl-mx-3"></div> + <span class="sl-ml-2 sl-text-warning">required</span> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>The ID of the team service team.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + officiis + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + + + </div> + </div> + </div> + + <div data-testid="two-column-right" class="sl-relative sl-w-2/5 sl-ml-16" style="max-width: 500px;"> + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-h-lg"> + <div class="sl--ml-2"> + Example request: + <select class="example-request-lang-toggle sl-text-base" + aria-label="Request Sample Language" + onchange="switchExampleLanguage(event.target.value);"> + <option>bash</option> + <option>javascript</option> + <option>php</option> + <option>python</option> + </select> + </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-bash" + style=""> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-bash">curl --request GET \ + --get "https://vine.openfoodnetwork.org.au/api/v1/admin/team-service-teams/officiis" \ + --header "Authorization: Bearer {YOUR_API_TOKEN}" \ + --header "Content-Type: application/json" \ + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..."</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-javascript" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-javascript">const url = new URL( + "https://vine.openfoodnetwork.org.au/api/v1/admin/team-service-teams/officiis" +); + +const headers = { + "Authorization": "Bearer {YOUR_API_TOKEN}", + "Content-Type": "application/json", + "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", +}; + +fetch(url, { + method: "GET", + headers, +}).then(response => response.json());</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-php" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-php">$client = new \GuzzleHttp\Client(); +$url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/team-service-teams/officiis'; +$response = $client->get( + $url, + [ + 'headers' => [ + 'Authorization' => 'Bearer {YOUR_API_TOKEN}', + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', + ], + ] +); +$body = $response->getBody(); +print_r(json_decode((string) $body));</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-python" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-python">import requests +import json + +url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/team-service-teams/officiis' +headers = { + 'Authorization': 'Bearer {YOUR_API_TOKEN}', + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' +} + +response = requests.request('GET', url, headers=headers) +response.json()</code></pre> </div> + </div> + </div> + </div> + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-py-2"> + <div class="sl--ml-2"> + <div class="sl-h-sm sl-text-base sl-font-medium sl-px-1.5 sl-text-muted sl-rounded sl-border-transparent sl-border"> + <div class="sl-mb-2 sl-inline-block">Example response:</div> + <div class="sl-mb-2 sl-inline-block"> + <select + class="example-response-GETapi-v1-admin-team-service-teams--id--toggle sl-text-base" + aria-label="Response sample" + onchange="switchExampleResponse('GETapi-v1-admin-team-service-teams--id-', event.target.value);"> + <option value="0">401</option> + </select></div> + </div> + </div> + </div> + <button type="button" + class="sl-button sl-h-sm sl-text-base sl-font-medium sl-px-1.5 hover:sl-bg-canvas-50 active:sl-bg-canvas-100 sl-text-muted hover:sl-text-body focus:sl-text-body sl-rounded sl-border-transparent sl-border disabled:sl-opacity-70"> + <div class="sl-mx-0"> + <svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="copy" + class="svg-inline--fa fa-copy fa-fw fa-sm sl-icon" role="img" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"> + <path fill="currentColor" + d="M384 96L384 0h-112c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48H464c26.51 0 48-21.49 48-48V128h-95.1C398.4 128 384 113.6 384 96zM416 0v96h96L416 0zM192 352V128h-144c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h192c26.51 0 48-21.49 48-48L288 416h-32C220.7 416 192 387.3 192 352z"></path> + </svg> + </div> + </button> + </div> + <div class="sl-panel__content-wrapper sl-bg-canvas-100 example-response-GETapi-v1-admin-team-service-teams--id- example-response-GETapi-v1-admin-team-service-teams--id--0" + style=" " + > + <div class="sl-panel__content sl-p-0"> <details class="sl-pl-2"> + <summary style="cursor: pointer; list-style: none;"> + <small> + <span class="expansion-chevrons"> + + <svg aria-hidden="true" focusable="false" data-prefix="fas" + data-icon="chevron-right" + class="svg-inline--fa fa-chevron-right fa-fw sl-icon sl-text-muted" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"> + <path fill="currentColor" + d="M96 480c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L242.8 256L73.38 86.63c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l192 192c12.5 12.5 12.5 32.75 0 45.25l-192 192C112.4 476.9 104.2 480 96 480z"></path> + </svg> + </span> + Headers + </small> + </summary> + <pre><code class="language-http"> cache-control + : no-cache, private + content-type + : application/json + access-control-allow-origin + : * + </code></pre> + </details> + + <pre><code style="max-height: 300px;" + class="language-json sl-overflow-x-auto sl-overflow-y-auto">{ + "message": "Unauthenticated." +}</code></pre> + </div> + </div> + </div> + </div> + </div> +</div> + + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-relative"> + <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> + <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" + id="endpoints-PUTapi-v1-admin-team-service-teams--id-"> + PUT/ {id} + </h2> + </div> + </div> + + <div class="sl-relative"> + <div title="https://vine.openfoodnetwork.org.au/api/v1/admin/team-service-teams/{id}" + class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" + > + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: darkblue;" + > + PUT + </div> + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: purple;" + > + PATCH + </div> + <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> + <div dir="rtl" + class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/admin/team-service-teams/{id}</div> + </div> + + <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" + style="background-color: darkred" + >requires authentication + </div> + </div> + </div> + + + </div> + <div class="sl-flex"> + <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> + <div class="sl-stack sl-stack--vertical sl-stack--10 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--8 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose"> + Headers + </h3> + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Authorization</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + Bearer {YOUR_API_TOKEN} + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + JWT eyJ0eXAiOiJKV... + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">URL Parameters</h3> + + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">id</div> + <span class="sl-truncate sl-text-muted">string</span> + </div> + <div class="sl-flex-1 sl-h-px sl-mx-3"></div> + <span class="sl-ml-2 sl-text-warning">required</span> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>The ID of the team service team.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + recusandae + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + + + </div> + </div> + </div> + + <div data-testid="two-column-right" class="sl-relative sl-w-2/5 sl-ml-16" style="max-width: 500px;"> + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-h-lg"> + <div class="sl--ml-2"> + Example request: + <select class="example-request-lang-toggle sl-text-base" + aria-label="Request Sample Language" + onchange="switchExampleLanguage(event.target.value);"> + <option>bash</option> + <option>javascript</option> + <option>php</option> + <option>python</option> + </select> + </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-bash" + style=""> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-bash">curl --request PUT \ + "https://vine.openfoodnetwork.org.au/api/v1/admin/team-service-teams/recusandae" \ + --header "Authorization: Bearer {YOUR_API_TOKEN}" \ + --header "Content-Type: application/json" \ + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..."</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-javascript" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-javascript">const url = new URL( + "https://vine.openfoodnetwork.org.au/api/v1/admin/team-service-teams/recusandae" +); + +const headers = { + "Authorization": "Bearer {YOUR_API_TOKEN}", + "Content-Type": "application/json", + "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", +}; + +fetch(url, { + method: "PUT", + headers, +}).then(response => response.json());</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-php" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-php">$client = new \GuzzleHttp\Client(); +$url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/team-service-teams/recusandae'; +$response = $client->put( + $url, + [ + 'headers' => [ + 'Authorization' => 'Bearer {YOUR_API_TOKEN}', + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', + ], + ] +); +$body = $response->getBody(); +print_r(json_decode((string) $body));</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-python" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-python">import requests +import json + +url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/team-service-teams/recusandae' +headers = { + 'Authorization': 'Bearer {YOUR_API_TOKEN}', + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' +} + +response = requests.request('PUT', url, headers=headers) +response.json()</code></pre> </div> + </div> + </div> + </div> + + </div> + </div> +</div> + + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-relative"> + <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> + <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" + id="endpoints-DELETEapi-v1-admin-team-service-teams--id-"> + DELETE / {id} + </h2> + </div> + </div> + + <div class="sl-relative"> + <div title="https://vine.openfoodnetwork.org.au/api/v1/admin/team-service-teams/{id}" + class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" + > + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: red;" + > + DELETE + </div> + <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> + <div dir="rtl" + class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/admin/team-service-teams/{id}</div> + </div> + + <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" + style="background-color: darkred" + >requires authentication + </div> + </div> + </div> + + + </div> + <div class="sl-flex"> + <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> + <div class="sl-stack sl-stack--vertical sl-stack--10 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--8 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose"> + Headers + </h3> + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Authorization</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + Bearer {YOUR_API_TOKEN} + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + JWT eyJ0eXAiOiJKV... + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">URL Parameters</h3> + + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">id</div> + <span class="sl-truncate sl-text-muted">string</span> + </div> + <div class="sl-flex-1 sl-h-px sl-mx-3"></div> + <span class="sl-ml-2 sl-text-warning">required</span> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>The ID of the team service team.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + nisi + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + + + </div> + </div> + </div> + + <div data-testid="two-column-right" class="sl-relative sl-w-2/5 sl-ml-16" style="max-width: 500px;"> + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-h-lg"> + <div class="sl--ml-2"> + Example request: + <select class="example-request-lang-toggle sl-text-base" + aria-label="Request Sample Language" + onchange="switchExampleLanguage(event.target.value);"> + <option>bash</option> + <option>javascript</option> + <option>php</option> + <option>python</option> + </select> + </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-bash" + style=""> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-bash">curl --request DELETE \ + "https://vine.openfoodnetwork.org.au/api/v1/admin/team-service-teams/nisi" \ + --header "Authorization: Bearer {YOUR_API_TOKEN}" \ + --header "Content-Type: application/json" \ + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..."</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-javascript" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-javascript">const url = new URL( + "https://vine.openfoodnetwork.org.au/api/v1/admin/team-service-teams/nisi" +); + +const headers = { + "Authorization": "Bearer {YOUR_API_TOKEN}", + "Content-Type": "application/json", + "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", +}; + +fetch(url, { + method: "DELETE", + headers, +}).then(response => response.json());</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-php" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-php">$client = new \GuzzleHttp\Client(); +$url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/team-service-teams/nisi'; +$response = $client->delete( + $url, + [ + 'headers' => [ + 'Authorization' => 'Bearer {YOUR_API_TOKEN}', + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', + ], + ] +); +$body = $response->getBody(); +print_r(json_decode((string) $body));</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-python" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-python">import requests +import json + +url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/team-service-teams/nisi' +headers = { + 'Authorization': 'Bearer {YOUR_API_TOKEN}', + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' +} + +response = requests.request('DELETE', url, headers=headers) +response.json()</code></pre> </div> + </div> + </div> + </div> + + </div> + </div> +</div> + + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-relative"> + <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> + <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" + id="endpoints-GETapi-v1-admin-team-users"> + GET / + </h2> + </div> + </div> + + <div class="sl-relative"> + <div title="https://vine.openfoodnetwork.org.au/api/v1/admin/team-users" + class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" + > + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: green;" + > + GET + </div> + <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> + <div dir="rtl" + class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/admin/team-users</div> + </div> + + <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" + style="background-color: darkred" + >requires authentication + </div> + </div> + </div> + + + </div> + <div class="sl-flex"> + <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> + <div class="sl-stack sl-stack--vertical sl-stack--10 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--8 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose"> + Headers + </h3> + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Authorization</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + Bearer {YOUR_API_TOKEN} + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + JWT eyJ0eXAiOiJKV... + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + + + + </div> + </div> + </div> + + <div data-testid="two-column-right" class="sl-relative sl-w-2/5 sl-ml-16" style="max-width: 500px;"> + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-h-lg"> + <div class="sl--ml-2"> + Example request: + <select class="example-request-lang-toggle sl-text-base" + aria-label="Request Sample Language" + onchange="switchExampleLanguage(event.target.value);"> + <option>bash</option> + <option>javascript</option> + <option>php</option> + <option>python</option> + </select> + </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-bash" + style=""> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-bash">curl --request GET \ + --get "https://vine.openfoodnetwork.org.au/api/v1/admin/team-users" \ + --header "Authorization: Bearer {YOUR_API_TOKEN}" \ + --header "Content-Type: application/json" \ + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..."</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-javascript" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-javascript">const url = new URL( + "https://vine.openfoodnetwork.org.au/api/v1/admin/team-users" +); + +const headers = { + "Authorization": "Bearer {YOUR_API_TOKEN}", + "Content-Type": "application/json", + "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", +}; + +fetch(url, { + method: "GET", + headers, +}).then(response => response.json());</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-php" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-php">$client = new \GuzzleHttp\Client(); +$url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/team-users'; +$response = $client->get( + $url, + [ + 'headers' => [ + 'Authorization' => 'Bearer {YOUR_API_TOKEN}', + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', + ], + ] +); +$body = $response->getBody(); +print_r(json_decode((string) $body));</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-python" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-python">import requests +import json + +url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/team-users' +headers = { + 'Authorization': 'Bearer {YOUR_API_TOKEN}', + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' +} + +response = requests.request('GET', url, headers=headers) +response.json()</code></pre> </div> + </div> + </div> + </div> + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-py-2"> + <div class="sl--ml-2"> + <div class="sl-h-sm sl-text-base sl-font-medium sl-px-1.5 sl-text-muted sl-rounded sl-border-transparent sl-border"> + <div class="sl-mb-2 sl-inline-block">Example response:</div> + <div class="sl-mb-2 sl-inline-block"> + <select + class="example-response-GETapi-v1-admin-team-users-toggle sl-text-base" + aria-label="Response sample" + onchange="switchExampleResponse('GETapi-v1-admin-team-users', event.target.value);"> + <option value="0">401</option> + </select></div> + </div> + </div> + </div> + <button type="button" + class="sl-button sl-h-sm sl-text-base sl-font-medium sl-px-1.5 hover:sl-bg-canvas-50 active:sl-bg-canvas-100 sl-text-muted hover:sl-text-body focus:sl-text-body sl-rounded sl-border-transparent sl-border disabled:sl-opacity-70"> + <div class="sl-mx-0"> + <svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="copy" + class="svg-inline--fa fa-copy fa-fw fa-sm sl-icon" role="img" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"> + <path fill="currentColor" + d="M384 96L384 0h-112c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48H464c26.51 0 48-21.49 48-48V128h-95.1C398.4 128 384 113.6 384 96zM416 0v96h96L416 0zM192 352V128h-144c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h192c26.51 0 48-21.49 48-48L288 416h-32C220.7 416 192 387.3 192 352z"></path> + </svg> + </div> + </button> + </div> + <div class="sl-panel__content-wrapper sl-bg-canvas-100 example-response-GETapi-v1-admin-team-users example-response-GETapi-v1-admin-team-users-0" + style=" " + > + <div class="sl-panel__content sl-p-0"> <details class="sl-pl-2"> + <summary style="cursor: pointer; list-style: none;"> + <small> + <span class="expansion-chevrons"> + + <svg aria-hidden="true" focusable="false" data-prefix="fas" + data-icon="chevron-right" + class="svg-inline--fa fa-chevron-right fa-fw sl-icon sl-text-muted" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"> + <path fill="currentColor" + d="M96 480c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L242.8 256L73.38 86.63c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l192 192c12.5 12.5 12.5 32.75 0 45.25l-192 192C112.4 476.9 104.2 480 96 480z"></path> + </svg> + </span> + Headers + </small> + </summary> + <pre><code class="language-http"> cache-control + : no-cache, private + content-type + : application/json + access-control-allow-origin + : * + </code></pre> + </details> + + <pre><code style="max-height: 300px;" + class="language-json sl-overflow-x-auto sl-overflow-y-auto">{ + "message": "Unauthenticated." +}</code></pre> + </div> + </div> + </div> + </div> + </div> +</div> + + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-relative"> + <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> + <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" + id="endpoints-POSTapi-v1-admin-team-users"> + POST api/v1/admin/team-users + </h2> + </div> + </div> + + <div class="sl-relative"> + <div title="https://vine.openfoodnetwork.org.au/api/v1/admin/team-users" + class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" + > + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: black;" + > + POST + </div> + <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> + <div dir="rtl" + class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/admin/team-users</div> + </div> + + <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" + style="background-color: darkred" + >requires authentication + </div> + </div> + </div> + + + </div> + <div class="sl-flex"> + <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> + <div class="sl-stack sl-stack--vertical sl-stack--10 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--8 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose"> + Headers + </h3> + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Authorization</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + Bearer {YOUR_API_TOKEN} + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + JWT eyJ0eXAiOiJKV... + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + + + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">Body Parameters</h3> + + <div class="sl-text-sm"> + <div class="expandable sl-text-sm sl-border-l sl-ml-px"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">team_id</div> + <span class="sl-truncate sl-text-muted">string</span> + </div> + <div class="sl-flex-1 sl-h-px sl-mx-3"></div> + <span class="sl-ml-2 sl-text-warning">required</span> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + unde + </div> + </div> + </div> + </div> +</div> + + </div> + <div class="expandable sl-text-sm sl-border-l sl-ml-px"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">user_id</div> + <span class="sl-truncate sl-text-muted">string</span> + </div> + <div class="sl-flex-1 sl-h-px sl-mx-3"></div> + <span class="sl-ml-2 sl-text-warning">required</span> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + culpa + </div> + </div> + </div> + </div> +</div> + + </div> + </div> + </div> + + </div> + </div> + </div> + + <div data-testid="two-column-right" class="sl-relative sl-w-2/5 sl-ml-16" style="max-width: 500px;"> + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-h-lg"> + <div class="sl--ml-2"> + Example request: + <select class="example-request-lang-toggle sl-text-base" + aria-label="Request Sample Language" + onchange="switchExampleLanguage(event.target.value);"> + <option>bash</option> + <option>javascript</option> + <option>php</option> + <option>python</option> + </select> + </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-bash" + style=""> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-bash">curl --request POST \ + "https://vine.openfoodnetwork.org.au/api/v1/admin/team-users" \ + --header "Authorization: Bearer {YOUR_API_TOKEN}" \ + --header "Content-Type: application/json" \ + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..." \ + --data "{ + \"team_id\": \"unde\", + \"user_id\": \"culpa\" +}" +</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-javascript" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-javascript">const url = new URL( + "https://vine.openfoodnetwork.org.au/api/v1/admin/team-users" +); + +const headers = { + "Authorization": "Bearer {YOUR_API_TOKEN}", + "Content-Type": "application/json", + "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", +}; + +let body = { + "team_id": "unde", + "user_id": "culpa" +}; + +fetch(url, { + method: "POST", + headers, + body: JSON.stringify(body), +}).then(response => response.json());</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-php" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-php">$client = new \GuzzleHttp\Client(); +$url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/team-users'; +$response = $client->post( + $url, + [ + 'headers' => [ + 'Authorization' => 'Bearer {YOUR_API_TOKEN}', + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', + ], + 'json' => [ + 'team_id' => 'unde', + 'user_id' => 'culpa', + ], + ] +); +$body = $response->getBody(); +print_r(json_decode((string) $body));</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-python" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-python">import requests +import json + +url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/team-users' +payload = { + "team_id": "unde", + "user_id": "culpa" +} +headers = { + 'Authorization': 'Bearer {YOUR_API_TOKEN}', + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' +} + +response = requests.request('POST', url, headers=headers, json=payload) +response.json()</code></pre> </div> + </div> + </div> + </div> + + </div> + </div> +</div> + + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-relative"> + <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> + <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" + id="endpoints-GETapi-v1-admin-team-users--id-"> + GET api/v1/admin/team-users/{id} + </h2> + </div> + </div> + + <div class="sl-relative"> + <div title="https://vine.openfoodnetwork.org.au/api/v1/admin/team-users/{id}" + class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" + > + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: green;" + > + GET + </div> + <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> + <div dir="rtl" + class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/admin/team-users/{id}</div> + </div> + + <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" + style="background-color: darkred" + >requires authentication + </div> + </div> + </div> + + + </div> + <div class="sl-flex"> + <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> + <div class="sl-stack sl-stack--vertical sl-stack--10 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--8 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose"> + Headers + </h3> + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Authorization</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + Bearer {YOUR_API_TOKEN} + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + JWT eyJ0eXAiOiJKV... + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">URL Parameters</h3> + + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">id</div> + <span class="sl-truncate sl-text-muted">string</span> + </div> + <div class="sl-flex-1 sl-h-px sl-mx-3"></div> + <span class="sl-ml-2 sl-text-warning">required</span> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>The ID of the team user.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + nam + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + + + </div> + </div> + </div> + + <div data-testid="two-column-right" class="sl-relative sl-w-2/5 sl-ml-16" style="max-width: 500px;"> + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-h-lg"> + <div class="sl--ml-2"> + Example request: + <select class="example-request-lang-toggle sl-text-base" + aria-label="Request Sample Language" + onchange="switchExampleLanguage(event.target.value);"> + <option>bash</option> + <option>javascript</option> + <option>php</option> + <option>python</option> + </select> + </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-bash" + style=""> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-bash">curl --request GET \ + --get "https://vine.openfoodnetwork.org.au/api/v1/admin/team-users/nam" \ + --header "Authorization: Bearer {YOUR_API_TOKEN}" \ + --header "Content-Type: application/json" \ + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..."</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-javascript" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-javascript">const url = new URL( + "https://vine.openfoodnetwork.org.au/api/v1/admin/team-users/nam" +); + +const headers = { + "Authorization": "Bearer {YOUR_API_TOKEN}", + "Content-Type": "application/json", + "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", +}; + +fetch(url, { + method: "GET", + headers, +}).then(response => response.json());</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-php" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-php">$client = new \GuzzleHttp\Client(); +$url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/team-users/nam'; +$response = $client->get( + $url, + [ + 'headers' => [ + 'Authorization' => 'Bearer {YOUR_API_TOKEN}', + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', + ], + ] +); +$body = $response->getBody(); +print_r(json_decode((string) $body));</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-python" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-python">import requests +import json + +url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/team-users/nam' +headers = { + 'Authorization': 'Bearer {YOUR_API_TOKEN}', + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' +} + +response = requests.request('GET', url, headers=headers) +response.json()</code></pre> </div> + </div> + </div> + </div> + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-py-2"> + <div class="sl--ml-2"> + <div class="sl-h-sm sl-text-base sl-font-medium sl-px-1.5 sl-text-muted sl-rounded sl-border-transparent sl-border"> + <div class="sl-mb-2 sl-inline-block">Example response:</div> + <div class="sl-mb-2 sl-inline-block"> + <select + class="example-response-GETapi-v1-admin-team-users--id--toggle sl-text-base" + aria-label="Response sample" + onchange="switchExampleResponse('GETapi-v1-admin-team-users--id-', event.target.value);"> + <option value="0">401</option> + </select></div> + </div> + </div> + </div> + <button type="button" + class="sl-button sl-h-sm sl-text-base sl-font-medium sl-px-1.5 hover:sl-bg-canvas-50 active:sl-bg-canvas-100 sl-text-muted hover:sl-text-body focus:sl-text-body sl-rounded sl-border-transparent sl-border disabled:sl-opacity-70"> + <div class="sl-mx-0"> + <svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="copy" + class="svg-inline--fa fa-copy fa-fw fa-sm sl-icon" role="img" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"> + <path fill="currentColor" + d="M384 96L384 0h-112c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48H464c26.51 0 48-21.49 48-48V128h-95.1C398.4 128 384 113.6 384 96zM416 0v96h96L416 0zM192 352V128h-144c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h192c26.51 0 48-21.49 48-48L288 416h-32C220.7 416 192 387.3 192 352z"></path> + </svg> + </div> + </button> + </div> + <div class="sl-panel__content-wrapper sl-bg-canvas-100 example-response-GETapi-v1-admin-team-users--id- example-response-GETapi-v1-admin-team-users--id--0" + style=" " + > + <div class="sl-panel__content sl-p-0"> <details class="sl-pl-2"> + <summary style="cursor: pointer; list-style: none;"> + <small> + <span class="expansion-chevrons"> + + <svg aria-hidden="true" focusable="false" data-prefix="fas" + data-icon="chevron-right" + class="svg-inline--fa fa-chevron-right fa-fw sl-icon sl-text-muted" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"> + <path fill="currentColor" + d="M96 480c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L242.8 256L73.38 86.63c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l192 192c12.5 12.5 12.5 32.75 0 45.25l-192 192C112.4 476.9 104.2 480 96 480z"></path> + </svg> + </span> + Headers + </small> + </summary> + <pre><code class="language-http"> cache-control + : no-cache, private + content-type + : application/json + access-control-allow-origin + : * + </code></pre> + </details> + + <pre><code style="max-height: 300px;" + class="language-json sl-overflow-x-auto sl-overflow-y-auto">{ + "message": "Unauthenticated." +}</code></pre> + </div> + </div> + </div> + </div> + </div> +</div> + + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-relative"> + <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> + <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" + id="endpoints-PUTapi-v1-admin-team-users--id-"> + PUT api/v1/admin/team-users/{id} + </h2> + </div> + </div> + + <div class="sl-relative"> + <div title="https://vine.openfoodnetwork.org.au/api/v1/admin/team-users/{id}" + class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" + > + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: darkblue;" + > + PUT + </div> + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: purple;" + > + PATCH + </div> + <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> + <div dir="rtl" + class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/admin/team-users/{id}</div> + </div> + + <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" + style="background-color: darkred" + >requires authentication + </div> + </div> + </div> + + + </div> + <div class="sl-flex"> + <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> + <div class="sl-stack sl-stack--vertical sl-stack--10 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--8 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose"> + Headers + </h3> + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Authorization</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + Bearer {YOUR_API_TOKEN} + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + JWT eyJ0eXAiOiJKV... + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">URL Parameters</h3> + + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">id</div> + <span class="sl-truncate sl-text-muted">string</span> + </div> + <div class="sl-flex-1 sl-h-px sl-mx-3"></div> + <span class="sl-ml-2 sl-text-warning">required</span> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>The ID of the team user.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + eaque + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">Body Parameters</h3> + + <div class="sl-text-sm"> + <div class="expandable sl-text-sm sl-border-l sl-ml-px"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">send_invite_email</div> + <span class="sl-truncate sl-text-muted">boolean</span> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + 1 + </div> + </div> + </div> + </div> +</div> + + </div> + </div> + </div> + + </div> + </div> + </div> + + <div data-testid="two-column-right" class="sl-relative sl-w-2/5 sl-ml-16" style="max-width: 500px;"> + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-h-lg"> + <div class="sl--ml-2"> + Example request: + <select class="example-request-lang-toggle sl-text-base" + aria-label="Request Sample Language" + onchange="switchExampleLanguage(event.target.value);"> + <option>bash</option> + <option>javascript</option> + <option>php</option> + <option>python</option> + </select> + </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-bash" + style=""> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-bash">curl --request PUT \ + "https://vine.openfoodnetwork.org.au/api/v1/admin/team-users/eaque" \ + --header "Authorization: Bearer {YOUR_API_TOKEN}" \ + --header "Content-Type: application/json" \ + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..." \ + --data "{ + \"send_invite_email\": true +}" +</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-javascript" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-javascript">const url = new URL( + "https://vine.openfoodnetwork.org.au/api/v1/admin/team-users/eaque" +); + +const headers = { + "Authorization": "Bearer {YOUR_API_TOKEN}", + "Content-Type": "application/json", + "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", +}; + +let body = { + "send_invite_email": true +}; + +fetch(url, { + method: "PUT", + headers, + body: JSON.stringify(body), +}).then(response => response.json());</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-php" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-php">$client = new \GuzzleHttp\Client(); +$url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/team-users/eaque'; +$response = $client->put( + $url, + [ + 'headers' => [ + 'Authorization' => 'Bearer {YOUR_API_TOKEN}', + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', + ], + 'json' => [ + 'send_invite_email' => true, + ], + ] +); +$body = $response->getBody(); +print_r(json_decode((string) $body));</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-python" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-python">import requests +import json + +url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/team-users/eaque' +payload = { + "send_invite_email": true +} +headers = { + 'Authorization': 'Bearer {YOUR_API_TOKEN}', + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' +} + +response = requests.request('PUT', url, headers=headers, json=payload) +response.json()</code></pre> </div> + </div> + </div> + </div> + + </div> + </div> +</div> + + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-relative"> + <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> + <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" + id="endpoints-DELETEapi-v1-admin-team-users--id-"> + DELETE /{id} + </h2> + </div> + </div> + + <div class="sl-relative"> + <div title="https://vine.openfoodnetwork.org.au/api/v1/admin/team-users/{id}" + class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" + > + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: red;" + > + DELETE + </div> + <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> + <div dir="rtl" + class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/admin/team-users/{id}</div> + </div> + + <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" + style="background-color: darkred" + >requires authentication + </div> + </div> + </div> + + + </div> + <div class="sl-flex"> + <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> + <div class="sl-stack sl-stack--vertical sl-stack--10 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--8 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose"> + Headers + </h3> + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Authorization</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + Bearer {YOUR_API_TOKEN} + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + JWT eyJ0eXAiOiJKV... + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">URL Parameters</h3> + + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">id</div> + <span class="sl-truncate sl-text-muted">string</span> + </div> + <div class="sl-flex-1 sl-h-px sl-mx-3"></div> + <span class="sl-ml-2 sl-text-warning">required</span> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>The ID of the team user.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + ipsam + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + + + </div> + </div> + </div> + + <div data-testid="two-column-right" class="sl-relative sl-w-2/5 sl-ml-16" style="max-width: 500px;"> + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-h-lg"> + <div class="sl--ml-2"> + Example request: + <select class="example-request-lang-toggle sl-text-base" + aria-label="Request Sample Language" + onchange="switchExampleLanguage(event.target.value);"> + <option>bash</option> + <option>javascript</option> + <option>php</option> + <option>python</option> + </select> + </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-bash" + style=""> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-bash">curl --request DELETE \ + "https://vine.openfoodnetwork.org.au/api/v1/admin/team-users/ipsam" \ + --header "Authorization: Bearer {YOUR_API_TOKEN}" \ + --header "Content-Type: application/json" \ + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..."</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-javascript" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-javascript">const url = new URL( + "https://vine.openfoodnetwork.org.au/api/v1/admin/team-users/ipsam" +); + +const headers = { + "Authorization": "Bearer {YOUR_API_TOKEN}", + "Content-Type": "application/json", + "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", +}; + +fetch(url, { + method: "DELETE", + headers, +}).then(response => response.json());</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-php" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-php">$client = new \GuzzleHttp\Client(); +$url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/team-users/ipsam'; +$response = $client->delete( + $url, + [ + 'headers' => [ + 'Authorization' => 'Bearer {YOUR_API_TOKEN}', + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', + ], + ] +); +$body = $response->getBody(); +print_r(json_decode((string) $body));</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-python" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-python">import requests +import json + +url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/team-users/ipsam' +headers = { + 'Authorization': 'Bearer {YOUR_API_TOKEN}', + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' +} + +response = requests.request('DELETE', url, headers=headers) +response.json()</code></pre> </div> + </div> + </div> + </div> + + </div> + </div> +</div> + + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-relative"> + <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> + <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" + id="endpoints-GETapi-v1-admin-teams"> + GET / + </h2> + </div> + </div> + + <div class="sl-relative"> + <div title="https://vine.openfoodnetwork.org.au/api/v1/admin/teams" + class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" + > + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: green;" + > + GET + </div> + <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> + <div dir="rtl" + class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/admin/teams</div> + </div> + + <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" + style="background-color: darkred" + >requires authentication + </div> + </div> + </div> + + + </div> + <div class="sl-flex"> + <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> + <div class="sl-stack sl-stack--vertical sl-stack--10 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--8 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose"> + Headers + </h3> + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Authorization</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + Bearer {YOUR_API_TOKEN} + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + JWT eyJ0eXAiOiJKV... + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + + + + </div> + </div> + </div> + + <div data-testid="two-column-right" class="sl-relative sl-w-2/5 sl-ml-16" style="max-width: 500px;"> + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-h-lg"> + <div class="sl--ml-2"> + Example request: + <select class="example-request-lang-toggle sl-text-base" + aria-label="Request Sample Language" + onchange="switchExampleLanguage(event.target.value);"> + <option>bash</option> + <option>javascript</option> + <option>php</option> + <option>python</option> + </select> + </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-bash" + style=""> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-bash">curl --request GET \ + --get "https://vine.openfoodnetwork.org.au/api/v1/admin/teams" \ + --header "Authorization: Bearer {YOUR_API_TOKEN}" \ + --header "Content-Type: application/json" \ + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..."</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-javascript" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-javascript">const url = new URL( + "https://vine.openfoodnetwork.org.au/api/v1/admin/teams" +); + +const headers = { + "Authorization": "Bearer {YOUR_API_TOKEN}", + "Content-Type": "application/json", + "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", +}; + +fetch(url, { + method: "GET", + headers, +}).then(response => response.json());</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-php" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-php">$client = new \GuzzleHttp\Client(); +$url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/teams'; +$response = $client->get( + $url, + [ + 'headers' => [ + 'Authorization' => 'Bearer {YOUR_API_TOKEN}', + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', + ], + ] +); +$body = $response->getBody(); +print_r(json_decode((string) $body));</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-python" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-python">import requests +import json + +url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/teams' +headers = { + 'Authorization': 'Bearer {YOUR_API_TOKEN}', + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' +} + +response = requests.request('GET', url, headers=headers) +response.json()</code></pre> </div> + </div> + </div> + </div> + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-py-2"> + <div class="sl--ml-2"> + <div class="sl-h-sm sl-text-base sl-font-medium sl-px-1.5 sl-text-muted sl-rounded sl-border-transparent sl-border"> + <div class="sl-mb-2 sl-inline-block">Example response:</div> + <div class="sl-mb-2 sl-inline-block"> + <select + class="example-response-GETapi-v1-admin-teams-toggle sl-text-base" + aria-label="Response sample" + onchange="switchExampleResponse('GETapi-v1-admin-teams', event.target.value);"> + <option value="0">401</option> + </select></div> + </div> + </div> + </div> + <button type="button" + class="sl-button sl-h-sm sl-text-base sl-font-medium sl-px-1.5 hover:sl-bg-canvas-50 active:sl-bg-canvas-100 sl-text-muted hover:sl-text-body focus:sl-text-body sl-rounded sl-border-transparent sl-border disabled:sl-opacity-70"> + <div class="sl-mx-0"> + <svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="copy" + class="svg-inline--fa fa-copy fa-fw fa-sm sl-icon" role="img" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"> + <path fill="currentColor" + d="M384 96L384 0h-112c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48H464c26.51 0 48-21.49 48-48V128h-95.1C398.4 128 384 113.6 384 96zM416 0v96h96L416 0zM192 352V128h-144c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h192c26.51 0 48-21.49 48-48L288 416h-32C220.7 416 192 387.3 192 352z"></path> + </svg> + </div> + </button> + </div> + <div class="sl-panel__content-wrapper sl-bg-canvas-100 example-response-GETapi-v1-admin-teams example-response-GETapi-v1-admin-teams-0" + style=" " + > + <div class="sl-panel__content sl-p-0"> <details class="sl-pl-2"> + <summary style="cursor: pointer; list-style: none;"> + <small> + <span class="expansion-chevrons"> + + <svg aria-hidden="true" focusable="false" data-prefix="fas" + data-icon="chevron-right" + class="svg-inline--fa fa-chevron-right fa-fw sl-icon sl-text-muted" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"> + <path fill="currentColor" + d="M96 480c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L242.8 256L73.38 86.63c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l192 192c12.5 12.5 12.5 32.75 0 45.25l-192 192C112.4 476.9 104.2 480 96 480z"></path> + </svg> + </span> + Headers + </small> + </summary> + <pre><code class="language-http"> cache-control + : no-cache, private + content-type + : application/json + access-control-allow-origin + : * + </code></pre> + </details> + + <pre><code style="max-height: 300px;" + class="language-json sl-overflow-x-auto sl-overflow-y-auto">{ + "message": "Unauthenticated." +}</code></pre> + </div> + </div> + </div> + </div> + </div> +</div> + + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-relative"> + <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> + <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" + id="endpoints-POSTapi-v1-admin-teams"> + POST / + </h2> + </div> + </div> + + <div class="sl-relative"> + <div title="https://vine.openfoodnetwork.org.au/api/v1/admin/teams" + class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" + > + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: black;" + > + POST + </div> + <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> + <div dir="rtl" + class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/admin/teams</div> + </div> + + <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" + style="background-color: darkred" + >requires authentication + </div> + </div> + </div> + + + </div> + <div class="sl-flex"> + <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> + <div class="sl-stack sl-stack--vertical sl-stack--10 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--8 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose"> + Headers + </h3> + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Authorization</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + Bearer {YOUR_API_TOKEN} + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + JWT eyJ0eXAiOiJKV... + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + + + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">Body Parameters</h3> + + <div class="sl-text-sm"> + <div class="expandable sl-text-sm sl-border-l sl-ml-px"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">name</div> + <span class="sl-truncate sl-text-muted">string</span> + </div> + <div class="sl-flex-1 sl-h-px sl-mx-3"></div> + <span class="sl-ml-2 sl-text-warning">required</span> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + est + </div> + </div> + </div> + </div> +</div> + + </div> + </div> + </div> + + </div> + </div> + </div> + + <div data-testid="two-column-right" class="sl-relative sl-w-2/5 sl-ml-16" style="max-width: 500px;"> + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-h-lg"> + <div class="sl--ml-2"> + Example request: + <select class="example-request-lang-toggle sl-text-base" + aria-label="Request Sample Language" + onchange="switchExampleLanguage(event.target.value);"> + <option>bash</option> + <option>javascript</option> + <option>php</option> + <option>python</option> + </select> + </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-bash" + style=""> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-bash">curl --request POST \ + "https://vine.openfoodnetwork.org.au/api/v1/admin/teams" \ + --header "Authorization: Bearer {YOUR_API_TOKEN}" \ + --header "Content-Type: application/json" \ + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..." \ + --data "{ + \"name\": \"est\" +}" +</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-javascript" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-javascript">const url = new URL( + "https://vine.openfoodnetwork.org.au/api/v1/admin/teams" +); + +const headers = { + "Authorization": "Bearer {YOUR_API_TOKEN}", + "Content-Type": "application/json", + "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", +}; + +let body = { + "name": "est" +}; + +fetch(url, { + method: "POST", + headers, + body: JSON.stringify(body), +}).then(response => response.json());</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-php" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-php">$client = new \GuzzleHttp\Client(); +$url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/teams'; +$response = $client->post( + $url, + [ + 'headers' => [ + 'Authorization' => 'Bearer {YOUR_API_TOKEN}', + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', + ], + 'json' => [ + 'name' => 'est', + ], + ] +); +$body = $response->getBody(); +print_r(json_decode((string) $body));</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-python" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-python">import requests +import json + +url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/teams' +payload = { + "name": "est" +} +headers = { + 'Authorization': 'Bearer {YOUR_API_TOKEN}', + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' +} + +response = requests.request('POST', url, headers=headers, json=payload) +response.json()</code></pre> </div> + </div> + </div> + </div> + + </div> + </div> +</div> + + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-relative"> + <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> + <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" + id="endpoints-GETapi-v1-admin-teams--id-"> + GET / {id} + </h2> + </div> + </div> + + <div class="sl-relative"> + <div title="https://vine.openfoodnetwork.org.au/api/v1/admin/teams/{id}" class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" > <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" @@ -490,7 +13885,7 @@ class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-i <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> <div dir="rtl" class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> - <div class="sl-flex-1 sl-font-semibold">/api/v1/my-team</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/admin/teams/{id}</div> </div> <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" @@ -500,7 +13895,7 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw </div> </div> - <p>Retrieve your team. Automatically filtered to your current team.</p> + </div> <div class="sl-flex"> <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> @@ -565,62 +13960,60 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw </div> </div> </div> - </div> - </div> - - - - <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> - <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">Query Parameters</h3> - - <div class="sl-text-sm"> - <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> <div class="sl-flex sl-items-center sl-max-w-full"> <div class="sl-flex sl-items-baseline sl-text-base"> - <div class="sl-font-mono sl-font-semibold sl-mr-2">cached</div> - <span class="sl-truncate sl-text-muted">boolean</span> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> </div> </div> - <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> - <p>Request the response to be cached. Default: <code>true</code>.</p> - </div> <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> <span>Example:</span> <!-- <span> important for spacing --> <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> - 1 + JWT eyJ0eXAiOiJKV... </div> </div> </div> </div> </div> - <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + </div> + </div> + + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">URL Parameters</h3> + + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> <div class="sl-flex sl-items-center sl-max-w-full"> <div class="sl-flex sl-items-baseline sl-text-base"> - <div class="sl-font-mono sl-font-semibold sl-mr-2">fields</div> + <div class="sl-font-mono sl-font-semibold sl-mr-2">id</div> <span class="sl-truncate sl-text-muted">string</span> </div> + <div class="sl-flex-1 sl-h-px sl-mx-3"></div> + <span class="sl-ml-2 sl-text-warning">required</span> </div> <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> - <p>Comma-separated list of database fields to return within the object.</p> + <p>The ID of the team.</p> </div> <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> <span>Example:</span> <!-- <span> important for spacing --> <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> - id,created_at + ad </div> </div> </div> </div> </div> - </div> + </div> </div> + + </div> </div> @@ -651,10 +14044,11 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <div class="sl-px-0 sl-py-1"> <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> <pre><code class="language-bash">curl --request GET \ - --get "https://vine.openfoodnetwork.org.au/api/v1/my-team?cached=1&fields=id%2Ccreated_at" \ + --get "https://vine.openfoodnetwork.org.au/api/v1/admin/teams/ad" \ --header "Authorization: Bearer {YOUR_API_TOKEN}" \ --header "Content-Type: application/json" \ - --header "Accept: application/json"</code></pre> </div> + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..."</code></pre> </div> </div> </div> <div class="sl-bg-canvas-100 example-request example-request-javascript" @@ -662,20 +14056,14 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <div class="sl-px-0 sl-py-1"> <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> <pre><code class="language-javascript">const url = new URL( - "https://vine.openfoodnetwork.org.au/api/v1/my-team" + "https://vine.openfoodnetwork.org.au/api/v1/admin/teams/ad" ); -const params = { - "cached": "1", - "fields": "id,created_at", -}; -Object.keys(params) - .forEach(key => url.searchParams.append(key, params[key])); - const headers = { "Authorization": "Bearer {YOUR_API_TOKEN}", "Content-Type": "application/json", "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", }; fetch(url, { @@ -689,7 +14077,7 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <div class="sl-px-0 sl-py-1"> <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> <pre><code class="language-php">$client = new \GuzzleHttp\Client(); -$url = 'https://vine.openfoodnetwork.org.au/api/v1/my-team'; +$url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/teams/ad'; $response = $client->get( $url, [ @@ -697,10 +14085,7 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw 'Authorization' => 'Bearer {YOUR_API_TOKEN}', 'Content-Type' => 'application/json', 'Accept' => 'application/json', - ], - 'query' => [ - 'cached' => '1', - 'fields' => 'id,created_at', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', ], ] ); @@ -715,18 +14100,15 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <pre><code class="language-python">import requests import json -url = 'https://vine.openfoodnetwork.org.au/api/v1/my-team' -params = { - 'cached': '1', - 'fields': 'id,created_at', -} +url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/teams/ad' headers = { 'Authorization': 'Bearer {YOUR_API_TOKEN}', 'Content-Type': 'application/json', - 'Accept': 'application/json' + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' } -response = requests.request('GET', url, headers=headers, params=params) +response = requests.request('GET', url, headers=headers) response.json()</code></pre> </div> </div> </div> @@ -740,10 +14122,10 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <div class="sl-mb-2 sl-inline-block">Example response:</div> <div class="sl-mb-2 sl-inline-block"> <select - class="example-response-GETapi-v1-my-team-toggle sl-text-base" + class="example-response-GETapi-v1-admin-teams--id--toggle sl-text-base" aria-label="Response sample" - onchange="switchExampleResponse('GETapi-v1-my-team', event.target.value);"> - <option value="0">200</option> + onchange="switchExampleResponse('GETapi-v1-admin-teams--id-', event.target.value);"> + <option value="0">401</option> </select></div> </div> </div> @@ -760,12 +14142,38 @@ class="svg-inline--fa fa-copy fa-fw fa-sm sl-icon" role="img" </div> </button> </div> - <div class="sl-panel__content-wrapper sl-bg-canvas-100 example-response-GETapi-v1-my-team example-response-GETapi-v1-my-team-0" + <div class="sl-panel__content-wrapper sl-bg-canvas-100 example-response-GETapi-v1-admin-teams--id- example-response-GETapi-v1-admin-teams--id--0" style=" " > - <div class="sl-panel__content sl-p-0"> + <div class="sl-panel__content sl-p-0"> <details class="sl-pl-2"> + <summary style="cursor: pointer; list-style: none;"> + <small> + <span class="expansion-chevrons"> + + <svg aria-hidden="true" focusable="false" data-prefix="fas" + data-icon="chevron-right" + class="svg-inline--fa fa-chevron-right fa-fw sl-icon sl-text-muted" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"> + <path fill="currentColor" + d="M96 480c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L242.8 256L73.38 86.63c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l192 192c12.5 12.5 12.5 32.75 0 45.25l-192 192C112.4 476.9 104.2 480 96 480z"></path> + </svg> + </span> + Headers + </small> + </summary> + <pre><code class="language-http"> cache-control + : no-cache, private + content-type + : application/json + access-control-allow-origin + : * + </code></pre> + </details> + <pre><code style="max-height: 300px;" - class="language-json sl-overflow-x-auto sl-overflow-y-auto">{"meta": {"responseCode": 200, "limit": 50, "offset": 0, "message": "", "cached": false, "availableRelations": []}, "data": {"current_page": 1, "data": {"id": 1, "name": "Team A", "created_at": "2024-08-16T06:54:28.000000Z", "updated_at": "2024-08-16T06:54:28.000000Z", "deleted_at": null}], "first_page_url": "https:\/\/vine.openfoodnetwork.org.au\/api\/v1\/my-teams?page=1", "from": 1, "last_page": 1, "last_page_url": "https:\/\/vine.openfoodnetwork.org.au\/api\/v1\/my-teams?page=1", "links": [{"url": null, "label": "&laquo; Previous", "active": false}, {"url": "https:\/\/vine.openfoodnetwork.org.au\/api\/v1\/my-teams?page=1", "label": "1", "active": true}, {"url": null, "label": "Next &raquo;", "active": false}], "next_page_url": null, "path": "https:\/\/vine.openfoodnetwork.org.au\/api\/v1\/my-teams", "per_page": 50, "prev_page_url": null, "to": 2, "total": 2}}</code></pre> + class="language-json sl-overflow-x-auto sl-overflow-y-auto">{ + "message": "Unauthenticated." +}</code></pre> </div> </div> </div> @@ -773,38 +14181,35 @@ class="language-json sl-overflow-x-auto sl-overflow-y-auto">{"meta": { </div> </div> - <h1 id="my-team-vouchers" - class="sl-text-5xl sl-leading-tight sl-font-prose sl-text-heading" - > - /my-team-vouchers - </h1> - - <p>Manage your team's vouchers. Returns vouchers generated by your team, and allocated to your team.</p> - - <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> <div class="sl-relative"> <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" - id="my-team-vouchers-GETapi-v1-my-team-vouchers"> - GET / + id="endpoints-PUTapi-v1-admin-teams--id-"> + PUT/ {id} </h2> </div> </div> <div class="sl-relative"> - <div title="https://vine.openfoodnetwork.org.au/api/v1/my-team-vouchers" + <div title="https://vine.openfoodnetwork.org.au/api/v1/admin/teams/{id}" class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" > <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" - style="background-color: green;" + style="background-color: darkblue;" > - GET + PUT + </div> + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: purple;" + > + PATCH </div> <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> <div dir="rtl" class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> - <div class="sl-flex-1 sl-font-semibold">/api/v1/my-team-vouchers</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/admin/teams/{id}</div> </div> <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" @@ -814,7 +14219,7 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw </div> </div> - <p>Retrieve vouchers. Automatically filtered to your current team.</p> + </div> <div class="sl-flex"> <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> @@ -879,194 +14284,337 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw </div> </div> </div> - </div> - </div> - - - - <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> - <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">Query Parameters</h3> - - <div class="sl-text-sm"> - <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> <div class="sl-flex sl-items-center sl-max-w-full"> <div class="sl-flex sl-items-baseline sl-text-base"> - <div class="sl-font-mono sl-font-semibold sl-mr-2">cached</div> - <span class="sl-truncate sl-text-muted">boolean</span> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> </div> </div> - <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> - <p>Request the response to be cached. Default: <code>true</code>.</p> - </div> <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> <span>Example:</span> <!-- <span> important for spacing --> <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> - 1 + JWT eyJ0eXAiOiJKV... </div> </div> </div> </div> </div> - <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + </div> + </div> + + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">URL Parameters</h3> + + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> <div class="sl-flex sl-items-center sl-max-w-full"> <div class="sl-flex sl-items-baseline sl-text-base"> - <div class="sl-font-mono sl-font-semibold sl-mr-2">page</div> - <span class="sl-truncate sl-text-muted">integer</span> + <div class="sl-font-mono sl-font-semibold sl-mr-2">id</div> + <span class="sl-truncate sl-text-muted">string</span> </div> + <div class="sl-flex-1 sl-h-px sl-mx-3"></div> + <span class="sl-ml-2 sl-text-warning">required</span> </div> <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> - <p>The pagination page number.</p> + <p>The ID of the team.</p> </div> <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> <span>Example:</span> <!-- <span> important for spacing --> <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> - 1 + aliquam </div> </div> </div> </div> </div> - <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + </div> + </div> + + + + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">Body Parameters</h3> + + <div class="sl-text-sm"> + <div class="expandable sl-text-sm sl-border-l sl-ml-px"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> <div class="sl-flex sl-items-center sl-max-w-full"> <div class="sl-flex sl-items-baseline sl-text-base"> - <div class="sl-font-mono sl-font-semibold sl-mr-2">limit</div> - <span class="sl-truncate sl-text-muted">integer</span> + <div class="sl-font-mono sl-font-semibold sl-mr-2">name</div> + <span class="sl-truncate sl-text-muted">string</span> + </div> + </div> + </div> +</div> + + </div> + </div> + </div> + + </div> + </div> + </div> + + <div data-testid="two-column-right" class="sl-relative sl-w-2/5 sl-ml-16" style="max-width: 500px;"> + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-h-lg"> + <div class="sl--ml-2"> + Example request: + <select class="example-request-lang-toggle sl-text-base" + aria-label="Request Sample Language" + onchange="switchExampleLanguage(event.target.value);"> + <option>bash</option> + <option>javascript</option> + <option>php</option> + <option>python</option> + </select> + </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-bash" + style=""> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-bash">curl --request PUT \ + "https://vine.openfoodnetwork.org.au/api/v1/admin/teams/aliquam" \ + --header "Authorization: Bearer {YOUR_API_TOKEN}" \ + --header "Content-Type: application/json" \ + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..." \ +</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-javascript" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-javascript">const url = new URL( + "https://vine.openfoodnetwork.org.au/api/v1/admin/teams/aliquam" +); + +const headers = { + "Authorization": "Bearer {YOUR_API_TOKEN}", + "Content-Type": "application/json", + "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", +}; + +fetch(url, { + method: "PUT", + headers, +}).then(response => response.json());</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-php" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-php">$client = new \GuzzleHttp\Client(); +$url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/teams/aliquam'; +$response = $client->put( + $url, + [ + 'headers' => [ + 'Authorization' => 'Bearer {YOUR_API_TOKEN}', + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', + ], + ] +); +$body = $response->getBody(); +print_r(json_decode((string) $body));</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-python" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-python">import requests +import json + +url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/teams/aliquam' +headers = { + 'Authorization': 'Bearer {YOUR_API_TOKEN}', + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' +} + +response = requests.request('PUT', url, headers=headers) +response.json()</code></pre> </div> </div> + </div> + </div> + + </div> + </div> +</div> + + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-relative"> + <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> + <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" + id="endpoints-DELETEapi-v1-admin-teams--id-"> + DELETE / {id} + </h2> + </div> + </div> + + <div class="sl-relative"> + <div title="https://vine.openfoodnetwork.org.au/api/v1/admin/teams/{id}" + class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" + > + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: red;" + > + DELETE + </div> + <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> + <div dir="rtl" + class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/admin/teams/{id}</div> + </div> + + <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" + style="background-color: darkred" + >requires authentication + </div> </div> - <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> - <p>The number of entries returned per pagination page.</p> </div> - <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> - <span>Example:</span> <!-- <span> important for spacing --> - <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> - <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> - 50 - </div> - </div> - </div> - </div> -</div> - <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + + + </div> + <div class="sl-flex"> + <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> + <div class="sl-stack sl-stack--vertical sl-stack--10 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--8 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose"> + Headers + </h3> + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> <div class="sl-flex sl-items-center sl-max-w-full"> <div class="sl-flex sl-items-baseline sl-text-base"> - <div class="sl-font-mono sl-font-semibold sl-mr-2">fields</div> - <span class="sl-truncate sl-text-muted">string</span> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Authorization</div> </div> </div> - <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> - <p>Comma-separated list of database fields to return within the object.</p> - </div> <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> <span>Example:</span> <!-- <span> important for spacing --> <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> - id,created_at + Bearer {YOUR_API_TOKEN} </div> </div> </div> </div> </div> - <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> <div class="sl-flex sl-items-center sl-max-w-full"> <div class="sl-flex sl-items-baseline sl-text-base"> - <div class="sl-font-mono sl-font-semibold sl-mr-2">orderBy</div> - <span class="sl-truncate sl-text-muted">comma-separated</span> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> </div> </div> - <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> - <p>Order the data by a given field. Comma-separated string.</p> - </div> <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> <span>Example:</span> <!-- <span> important for spacing --> <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> - orderBy=id,desc + application/json </div> </div> </div> </div> </div> - <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> <div class="sl-flex sl-items-center sl-max-w-full"> <div class="sl-flex sl-items-baseline sl-text-base"> - <div class="sl-font-mono sl-font-semibold sl-mr-2">orderBy[]</div> - <span class="sl-truncate sl-text-muted">comma-separated</span> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> </div> </div> - <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> - <p>Compound <code>orderBy</code>. Order the data by a given field. Comma-separated string. Can not be used in conjunction as standard <code>orderBy</code>.</p> - </div> <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> <span>Example:</span> <!-- <span> important for spacing --> <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> - orderBy[]=id,desc&orderBy[]=created_at,asc + application/json </div> </div> </div> </div> </div> - <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> <div class="sl-flex sl-items-center sl-max-w-full"> <div class="sl-flex sl-items-baseline sl-text-base"> - <div class="sl-font-mono sl-font-semibold sl-mr-2">where</div> - <span class="sl-truncate sl-text-muted">comma-separated</span> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> </div> </div> - <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> - <p>Filter the request on a single field. Key-Value or Key-Operator-Value comma-separated string.</p> - </div> <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> <span>Example:</span> <!-- <span> important for spacing --> <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> - where=id,like,*550e* + JWT eyJ0eXAiOiJKV... </div> </div> </div> </div> </div> - <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + </div> + </div> + + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">URL Parameters</h3> + + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> <div class="sl-flex sl-items-center sl-max-w-full"> <div class="sl-flex sl-items-baseline sl-text-base"> - <div class="sl-font-mono sl-font-semibold sl-mr-2">where[]</div> - <span class="sl-truncate sl-text-muted">comma-separated</span> + <div class="sl-font-mono sl-font-semibold sl-mr-2">id</div> + <span class="sl-truncate sl-text-muted">string</span> </div> + <div class="sl-flex-1 sl-h-px sl-mx-3"></div> + <span class="sl-ml-2 sl-text-warning">required</span> </div> <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> - <p>Compound <code>where</code>. Use when you need to filter on multiple <code>where</code>'s. Note only AND is possible; ORWHERE is not available.</p> + <p>The ID of the team.</p> </div> <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> <span>Example:</span> <!-- <span> important for spacing --> <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> - where[]=id,like,*550e*&where[]=created_at,>=,2024-01-01 + aliquam </div> </div> </div> </div> </div> - </div> + </div> </div> + + </div> </div> @@ -1096,11 +14644,12 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw style=""> <div class="sl-px-0 sl-py-1"> <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> - <pre><code class="language-bash">curl --request GET \ - --get "https://vine.openfoodnetwork.org.au/api/v1/my-team-vouchers?cached=1&page=1&limit=50&fields=id%2Ccreated_at&orderBy=orderBy%3Did%2Cdesc&orderBy%5B%5D=orderBy%5B%5D%3Did%2Cdesc%26orderBy%5B%5D%3Dcreated_at%2Casc&where=where%3Did%2Clike%2C%2A550e%2A&where%5B%5D=where%5B%5D%3Did%2Clike%2C%2A550e%2A%26where%5B%5D%3Dcreated_at%2C%3E%3D%2C2024-01-01" \ + <pre><code class="language-bash">curl --request DELETE \ + "https://vine.openfoodnetwork.org.au/api/v1/admin/teams/aliquam" \ --header "Authorization: Bearer {YOUR_API_TOKEN}" \ --header "Content-Type: application/json" \ - --header "Accept: application/json"</code></pre> </div> + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..."</code></pre> </div> </div> </div> <div class="sl-bg-canvas-100 example-request example-request-javascript" @@ -1108,30 +14657,18 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <div class="sl-px-0 sl-py-1"> <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> <pre><code class="language-javascript">const url = new URL( - "https://vine.openfoodnetwork.org.au/api/v1/my-team-vouchers" + "https://vine.openfoodnetwork.org.au/api/v1/admin/teams/aliquam" ); -const params = { - "cached": "1", - "page": "1", - "limit": "50", - "fields": "id,created_at", - "orderBy": "orderBy=id,desc", - "orderBy[]": "orderBy[]=id,desc&orderBy[]=created_at,asc", - "where": "where=id,like,*550e*", - "where[]": "where[]=id,like,*550e*&where[]=created_at,>=,2024-01-01", -}; -Object.keys(params) - .forEach(key => url.searchParams.append(key, params[key])); - const headers = { "Authorization": "Bearer {YOUR_API_TOKEN}", "Content-Type": "application/json", "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", }; fetch(url, { - method: "GET", + method: "DELETE", headers, }).then(response => response.json());</code></pre> </div> </div> @@ -1141,24 +14678,15 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <div class="sl-px-0 sl-py-1"> <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> <pre><code class="language-php">$client = new \GuzzleHttp\Client(); -$url = 'https://vine.openfoodnetwork.org.au/api/v1/my-team-vouchers'; -$response = $client->get( +$url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/teams/aliquam'; +$response = $client->delete( $url, [ 'headers' => [ 'Authorization' => 'Bearer {YOUR_API_TOKEN}', 'Content-Type' => 'application/json', 'Accept' => 'application/json', - ], - 'query' => [ - 'cached' => '1', - 'page' => '1', - 'limit' => '50', - 'fields' => 'id,created_at', - 'orderBy' => 'orderBy=id,desc', - 'orderBy[]' => 'orderBy[]=id,desc&orderBy[]=created_at,asc', - 'where' => 'where=id,like,*550e*', - 'where[]' => 'where[]=id,like,*550e*&where[]=created_at,>=,2024-01-01', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', ], ] ); @@ -1173,111 +14701,20 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <pre><code class="language-python">import requests import json -url = 'https://vine.openfoodnetwork.org.au/api/v1/my-team-vouchers' -params = { - 'cached': '1', - 'page': '1', - 'limit': '50', - 'fields': 'id,created_at', - 'orderBy': 'orderBy=id,desc', - 'orderBy[]': 'orderBy[]=id,desc&orderBy[]=created_at,asc', - 'where': 'where=id,like,*550e*', - 'where[]': 'where[]=id,like,*550e*&where[]=created_at,>=,2024-01-01', -} +url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/teams/aliquam' headers = { 'Authorization': 'Bearer {YOUR_API_TOKEN}', 'Content-Type': 'application/json', - 'Accept': 'application/json' + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' } -response = requests.request('GET', url, headers=headers, params=params) +response = requests.request('DELETE', url, headers=headers) response.json()</code></pre> </div> </div> </div> </div> - <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> - <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> - <div class="sl-flex sl-flex-1 sl-items-center sl-py-2"> - <div class="sl--ml-2"> - <div class="sl-h-sm sl-text-base sl-font-medium sl-px-1.5 sl-text-muted sl-rounded sl-border-transparent sl-border"> - <div class="sl-mb-2 sl-inline-block">Example response:</div> - <div class="sl-mb-2 sl-inline-block"> - <select - class="example-response-GETapi-v1-my-team-vouchers-toggle sl-text-base" - aria-label="Response sample" - onchange="switchExampleResponse('GETapi-v1-my-team-vouchers', event.target.value);"> - <option value="0">200</option> - </select></div> - </div> - </div> - </div> - <button type="button" - class="sl-button sl-h-sm sl-text-base sl-font-medium sl-px-1.5 hover:sl-bg-canvas-50 active:sl-bg-canvas-100 sl-text-muted hover:sl-text-body focus:sl-text-body sl-rounded sl-border-transparent sl-border disabled:sl-opacity-70"> - <div class="sl-mx-0"> - <svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="copy" - class="svg-inline--fa fa-copy fa-fw fa-sm sl-icon" role="img" - xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"> - <path fill="currentColor" - d="M384 96L384 0h-112c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48H464c26.51 0 48-21.49 48-48V128h-95.1C398.4 128 384 113.6 384 96zM416 0v96h96L416 0zM192 352V128h-144c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h192c26.51 0 48-21.49 48-48L288 416h-32C220.7 416 192 387.3 192 352z"></path> - </svg> - </div> - </button> - </div> - <div class="sl-panel__content-wrapper sl-bg-canvas-100 example-response-GETapi-v1-my-team-vouchers example-response-GETapi-v1-my-team-vouchers-0" - style=" " - > - <div class="sl-panel__content sl-p-0"> - <pre><code style="max-height: 300px;" - class="language-json sl-overflow-x-auto sl-overflow-y-auto">{ - "meta": { - "responseCode": 200, - "limit": 50, - "offset": 0, - "message": "", - "cached": false, - "availableRelations": [] - }, - "data": { - "current_page": 1, - "data": [ - { - "id": "550e8400-e29b-41d4-a716-446655440000", - "created_at": "2024-01-01 00:00:00" - } - ], - "first_page_url": "https://open-food-network-vouchers.test/api/v1/admin/system-statistics?page=1", - "from": null, - "last_page": 1, - "last_page_url": "https://open-food-network-vouchers.test/api/v1/admin/system-statistics?page=1", - "links": [ - { - "url": null, - "label": "&laquo; Previous", - "active": false - }, - { - "url": "https://open-food-network-vouchers.test/api/v1/admin/system-statistics?page=1", - "label": "1", - "active": true - }, - { - "url": null, - "label": "Next &raquo;", - "active": false - } - ], - "next_page_url": null, - "path": "https://open-food-network-vouchers.test/api/v1/admin/system-statistics", - "per_page": 1, - "prev_page_url": null, - "to": null, - "total": 0 - } -}</code></pre> - </div> - </div> - </div> </div> </div> </div> @@ -1287,14 +14724,14 @@ class="language-json sl-overflow-x-auto sl-overflow-y-auto">{ <div class="sl-relative"> <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" - id="my-team-vouchers-GETapi-v1-my-team-vouchers--id-"> - GET /{id} + id="endpoints-GETapi-v1-admin-user-personal-access-tokens"> + GET / </h2> </div> </div> <div class="sl-relative"> - <div title="https://vine.openfoodnetwork.org.au/api/v1/my-team-vouchers/{id}" + <div title="https://vine.openfoodnetwork.org.au/api/v1/admin/user-personal-access-tokens" class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" > <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" @@ -1305,7 +14742,7 @@ class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-i <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> <div dir="rtl" class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> - <div class="sl-flex-1 sl-font-semibold">/api/v1/my-team-vouchers/{id}</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/admin/user-personal-access-tokens</div> </div> <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" @@ -1315,7 +14752,7 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw </div> </div> - <p>Retrieve a single voucher.</p> + </div> <div class="sl-flex"> <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> @@ -1338,135 +14775,73 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <span>Example:</span> <!-- <span> important for spacing --> <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> - Bearer {YOUR_API_TOKEN} - </div> - </div> - </div> - </div> -</div> - <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> - <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> - <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> - <div class="sl-flex sl-items-center sl-max-w-full"> - <div class="sl-flex sl-items-baseline sl-text-base"> - <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> - </div> - </div> - <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> - <span>Example:</span> <!-- <span> important for spacing --> - <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> - <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> - application/json - </div> - </div> - </div> - </div> -</div> - <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> - <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> - <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> - <div class="sl-flex sl-items-center sl-max-w-full"> - <div class="sl-flex sl-items-baseline sl-text-base"> - <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> - </div> - </div> - <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> - <span>Example:</span> <!-- <span> important for spacing --> - <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> - <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> - application/json + Bearer {YOUR_API_TOKEN} </div> </div> </div> </div> </div> - </div> - </div> - - <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> - <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">URL Parameters</h3> - - <div class="sl-text-sm"> <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> <div class="sl-flex sl-items-center sl-max-w-full"> <div class="sl-flex sl-items-baseline sl-text-base"> - <div class="sl-font-mono sl-font-semibold sl-mr-2">id</div> - <span class="sl-truncate sl-text-muted">uuid</span> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> </div> - <div class="sl-flex-1 sl-h-px sl-mx-3"></div> - <span class="sl-ml-2 sl-text-warning">required</span> </div> - <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> - <p>Voucher ID.</p> - </div> <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> <span>Example:</span> <!-- <span> important for spacing --> <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> - 550e8400-e29b-41d4-a716-446655440000 + application/json </div> </div> </div> </div> </div> - </div> - </div> - - - <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> - <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">Query Parameters</h3> - - <div class="sl-text-sm"> - <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> <div class="sl-flex sl-items-center sl-max-w-full"> <div class="sl-flex sl-items-baseline sl-text-base"> - <div class="sl-font-mono sl-font-semibold sl-mr-2">cached</div> - <span class="sl-truncate sl-text-muted">boolean</span> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> </div> </div> - <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> - <p>Request the response to be cached. Default: <code>true</code>.</p> - </div> <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> <span>Example:</span> <!-- <span> important for spacing --> <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> - 1 + application/json </div> </div> </div> </div> </div> - <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> <div class="sl-flex sl-items-center sl-max-w-full"> <div class="sl-flex sl-items-baseline sl-text-base"> - <div class="sl-font-mono sl-font-semibold sl-mr-2">fields</div> - <span class="sl-truncate sl-text-muted">string</span> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> </div> </div> - <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> - <p>Comma-separated list of database fields to return within the object.</p> - </div> <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> <span>Example:</span> <!-- <span> important for spacing --> <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> - id,created_at + JWT eyJ0eXAiOiJKV... </div> </div> </div> </div> </div> - </div> + </div> </div> + + + </div> </div> </div> @@ -1496,10 +14871,11 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <div class="sl-px-0 sl-py-1"> <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> <pre><code class="language-bash">curl --request GET \ - --get "https://vine.openfoodnetwork.org.au/api/v1/my-team-vouchers/550e8400-e29b-41d4-a716-446655440000?cached=1&fields=id%2Ccreated_at" \ + --get "https://vine.openfoodnetwork.org.au/api/v1/admin/user-personal-access-tokens" \ --header "Authorization: Bearer {YOUR_API_TOKEN}" \ --header "Content-Type: application/json" \ - --header "Accept: application/json"</code></pre> </div> + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..."</code></pre> </div> </div> </div> <div class="sl-bg-canvas-100 example-request example-request-javascript" @@ -1507,20 +14883,14 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <div class="sl-px-0 sl-py-1"> <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> <pre><code class="language-javascript">const url = new URL( - "https://vine.openfoodnetwork.org.au/api/v1/my-team-vouchers/550e8400-e29b-41d4-a716-446655440000" + "https://vine.openfoodnetwork.org.au/api/v1/admin/user-personal-access-tokens" ); -const params = { - "cached": "1", - "fields": "id,created_at", -}; -Object.keys(params) - .forEach(key => url.searchParams.append(key, params[key])); - const headers = { "Authorization": "Bearer {YOUR_API_TOKEN}", "Content-Type": "application/json", "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", }; fetch(url, { @@ -1534,7 +14904,7 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <div class="sl-px-0 sl-py-1"> <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> <pre><code class="language-php">$client = new \GuzzleHttp\Client(); -$url = 'https://vine.openfoodnetwork.org.au/api/v1/my-team-vouchers/550e8400-e29b-41d4-a716-446655440000'; +$url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/user-personal-access-tokens'; $response = $client->get( $url, [ @@ -1542,10 +14912,7 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw 'Authorization' => 'Bearer {YOUR_API_TOKEN}', 'Content-Type' => 'application/json', 'Accept' => 'application/json', - ], - 'query' => [ - 'cached' => '1', - 'fields' => 'id,created_at', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', ], ] ); @@ -1560,18 +14927,15 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <pre><code class="language-python">import requests import json -url = 'https://vine.openfoodnetwork.org.au/api/v1/my-team-vouchers/550e8400-e29b-41d4-a716-446655440000' -params = { - 'cached': '1', - 'fields': 'id,created_at', -} +url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/user-personal-access-tokens' headers = { 'Authorization': 'Bearer {YOUR_API_TOKEN}', 'Content-Type': 'application/json', - 'Accept': 'application/json' + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' } -response = requests.request('GET', url, headers=headers, params=params) +response = requests.request('GET', url, headers=headers) response.json()</code></pre> </div> </div> </div> @@ -1585,10 +14949,10 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <div class="sl-mb-2 sl-inline-block">Example response:</div> <div class="sl-mb-2 sl-inline-block"> <select - class="example-response-GETapi-v1-my-team-vouchers--id--toggle sl-text-base" + class="example-response-GETapi-v1-admin-user-personal-access-tokens-toggle sl-text-base" aria-label="Response sample" - onchange="switchExampleResponse('GETapi-v1-my-team-vouchers--id-', event.target.value);"> - <option value="0">200</option> + onchange="switchExampleResponse('GETapi-v1-admin-user-personal-access-tokens', event.target.value);"> + <option value="0">401</option> </select></div> </div> </div> @@ -1605,25 +14969,37 @@ class="svg-inline--fa fa-copy fa-fw fa-sm sl-icon" role="img" </div> </button> </div> - <div class="sl-panel__content-wrapper sl-bg-canvas-100 example-response-GETapi-v1-my-team-vouchers--id- example-response-GETapi-v1-my-team-vouchers--id--0" + <div class="sl-panel__content-wrapper sl-bg-canvas-100 example-response-GETapi-v1-admin-user-personal-access-tokens example-response-GETapi-v1-admin-user-personal-access-tokens-0" style=" " > - <div class="sl-panel__content sl-p-0"> + <div class="sl-panel__content sl-p-0"> <details class="sl-pl-2"> + <summary style="cursor: pointer; list-style: none;"> + <small> + <span class="expansion-chevrons"> + + <svg aria-hidden="true" focusable="false" data-prefix="fas" + data-icon="chevron-right" + class="svg-inline--fa fa-chevron-right fa-fw sl-icon sl-text-muted" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"> + <path fill="currentColor" + d="M96 480c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L242.8 256L73.38 86.63c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l192 192c12.5 12.5 12.5 32.75 0 45.25l-192 192C112.4 476.9 104.2 480 96 480z"></path> + </svg> + </span> + Headers + </small> + </summary> + <pre><code class="language-http"> cache-control + : no-cache, private + content-type + : application/json + access-control-allow-origin + : * + </code></pre> + </details> + <pre><code style="max-height: 300px;" class="language-json sl-overflow-x-auto sl-overflow-y-auto">{ - "meta": { - "responseCode": 200, - "limit": 50, - "offset": 0, - "message": "", - "cached": true, - "cached_at": "2024-08-13 08:58:19", - "availableRelations": [] - }, - "data": { - "id": 1234, - "created_at": "2024-01-01 00:00:00" - } + "message": "Unauthenticated." }</code></pre> </div> </div> @@ -1632,38 +15008,30 @@ class="language-json sl-overflow-x-auto sl-overflow-y-auto">{ </div> </div> - <h1 id="my-teams" - class="sl-text-5xl sl-leading-tight sl-font-prose sl-text-heading" - > - /my-teams - </h1> - - <p>Teams you are a member of.</p> - - <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> <div class="sl-relative"> <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" - id="my-teams-GETapi-v1-my-teams"> - GET / + id="endpoints-POSTapi-v1-admin-user-personal-access-tokens"> + POST / </h2> </div> </div> <div class="sl-relative"> - <div title="https://vine.openfoodnetwork.org.au/api/v1/my-teams" + <div title="https://vine.openfoodnetwork.org.au/api/v1/admin/user-personal-access-tokens" class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" > <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" - style="background-color: green;" + style="background-color: black;" > - GET + POST </div> <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> <div dir="rtl" class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> - <div class="sl-flex-1 sl-font-semibold">/api/v1/my-teams</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/admin/user-personal-access-tokens</div> </div> <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" @@ -1673,7 +15041,7 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw </div> </div> - <p>Retrieve your teams. Automatically filtered to your profile.</p> + </div> <div class="sl-flex"> <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> @@ -1738,195 +15106,99 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw </div> </div> </div> - </div> - </div> - - - - <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> - <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">Query Parameters</h3> - - <div class="sl-text-sm"> - <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> - <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> - <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> - <div class="sl-flex sl-items-center sl-max-w-full"> - <div class="sl-flex sl-items-baseline sl-text-base"> - <div class="sl-font-mono sl-font-semibold sl-mr-2">cached</div> - <span class="sl-truncate sl-text-muted">boolean</span> - </div> - </div> - <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> - <p>Request the response to be cached. Default: <code>true</code>.</p> - </div> - <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> - <span>Example:</span> <!-- <span> important for spacing --> - <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> - <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> - 1 - </div> - </div> - </div> - </div> -</div> - <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> - <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> - <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> - <div class="sl-flex sl-items-center sl-max-w-full"> - <div class="sl-flex sl-items-baseline sl-text-base"> - <div class="sl-font-mono sl-font-semibold sl-mr-2">page</div> - <span class="sl-truncate sl-text-muted">integer</span> - </div> - </div> - <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> - <p>The pagination page number.</p> - </div> - <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> - <span>Example:</span> <!-- <span> important for spacing --> - <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> - <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> - 1 - </div> - </div> - </div> - </div> -</div> - <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> - <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> - <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> - <div class="sl-flex sl-items-center sl-max-w-full"> - <div class="sl-flex sl-items-baseline sl-text-base"> - <div class="sl-font-mono sl-font-semibold sl-mr-2">limit</div> - <span class="sl-truncate sl-text-muted">integer</span> - </div> - </div> - <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> - <p>The number of entries returned per pagination page.</p> - </div> - <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> - <span>Example:</span> <!-- <span> important for spacing --> - <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> - <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> - 50 - </div> - </div> - </div> - </div> -</div> - <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> - <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> - <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> - <div class="sl-flex sl-items-center sl-max-w-full"> - <div class="sl-flex sl-items-baseline sl-text-base"> - <div class="sl-font-mono sl-font-semibold sl-mr-2">fields</div> - <span class="sl-truncate sl-text-muted">string</span> - </div> - </div> - <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> - <p>Comma-separated list of database fields to return within the object.</p> - </div> - <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> - <span>Example:</span> <!-- <span> important for spacing --> - <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> - <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> - id,created_at - </div> - </div> - </div> - </div> -</div> - <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> - <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> - <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> - <div class="sl-flex sl-items-center sl-max-w-full"> - <div class="sl-flex sl-items-baseline sl-text-base"> - <div class="sl-font-mono sl-font-semibold sl-mr-2">orderBy</div> - <span class="sl-truncate sl-text-muted">comma-separated</span> - </div> - </div> - <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> - <p>Order the data by a given field. Comma-separated string.</p> - </div> - <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> - <span>Example:</span> <!-- <span> important for spacing --> - <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> - <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> - orderBy=id,desc - </div> - </div> - </div> - </div> -</div> - <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> <div class="sl-flex sl-items-center sl-max-w-full"> <div class="sl-flex sl-items-baseline sl-text-base"> - <div class="sl-font-mono sl-font-semibold sl-mr-2">orderBy[]</div> - <span class="sl-truncate sl-text-muted">comma-separated</span> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> </div> </div> - <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> - <p>Compound <code>orderBy</code>. Order the data by a given field. Comma-separated string. Can not be used in conjunction as standard <code>orderBy</code>.</p> - </div> <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> <span>Example:</span> <!-- <span> important for spacing --> <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> - orderBy[]=id,desc&orderBy[]=created_at,asc + JWT eyJ0eXAiOiJKV... </div> </div> </div> </div> </div> - <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + </div> + </div> + + + + + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">Body Parameters</h3> + + <div class="sl-text-sm"> + <div class="expandable sl-text-sm sl-border-l sl-ml-px"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> <div class="sl-flex sl-items-center sl-max-w-full"> <div class="sl-flex sl-items-baseline sl-text-base"> - <div class="sl-font-mono sl-font-semibold sl-mr-2">where</div> - <span class="sl-truncate sl-text-muted">comma-separated</span> + <div class="sl-font-mono sl-font-semibold sl-mr-2">user_id</div> + <span class="sl-truncate sl-text-muted">string</span> </div> + <div class="sl-flex-1 sl-h-px sl-mx-3"></div> + <span class="sl-ml-2 sl-text-warning">required</span> </div> - <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> - <p>Filter the request on a single field. Key-Value or Key-Operator-Value comma-separated string.</p> - </div> <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> <span>Example:</span> <!-- <span> important for spacing --> <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> - where=id,like,*550e* + expedita </div> </div> </div> </div> </div> - <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + + </div> + <div class="expandable sl-text-sm sl-border-l sl-ml-px"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> <div class="sl-flex sl-items-center sl-max-w-full"> <div class="sl-flex sl-items-baseline sl-text-base"> - <div class="sl-font-mono sl-font-semibold sl-mr-2">where[]</div> - <span class="sl-truncate sl-text-muted">comma-separated</span> + <div class="sl-font-mono sl-font-semibold sl-mr-2">name</div> + <span class="sl-truncate sl-text-muted">string</span> </div> + <div class="sl-flex-1 sl-h-px sl-mx-3"></div> + <span class="sl-ml-2 sl-text-warning">required</span> </div> - <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> - <p>Compound <code>where</code>. Use when you need to filter on multiple <code>where</code>'s. Note only AND is possible; ORWHERE is not available.</p> - </div> <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> <span>Example:</span> <!-- <span> important for spacing --> <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> - where[]=id,like,*550e*&where[]=created_at,>=,2024-01-01 + exercitationem </div> </div> </div> </div> </div> - </div> + + </div> + <div class="expandable sl-text-sm sl-border-l sl-ml-px"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">token_abilities</div> + <span class="sl-truncate sl-text-muted">string[]</span> + </div> + </div> + </div> +</div> + + </div> + </div> </div> - </div> </div> </div> @@ -1955,11 +15227,17 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw style=""> <div class="sl-px-0 sl-py-1"> <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> - <pre><code class="language-bash">curl --request GET \ - --get "https://vine.openfoodnetwork.org.au/api/v1/my-teams?cached=1&page=1&limit=50&fields=id%2Ccreated_at&orderBy=orderBy%3Did%2Cdesc&orderBy%5B%5D=orderBy%5B%5D%3Did%2Cdesc%26orderBy%5B%5D%3Dcreated_at%2Casc&where=where%3Did%2Clike%2C%2A550e%2A&where%5B%5D=where%5B%5D%3Did%2Clike%2C%2A550e%2A%26where%5B%5D%3Dcreated_at%2C%3E%3D%2C2024-01-01" \ + <pre><code class="language-bash">curl --request POST \ + "https://vine.openfoodnetwork.org.au/api/v1/admin/user-personal-access-tokens" \ --header "Authorization: Bearer {YOUR_API_TOKEN}" \ --header "Content-Type: application/json" \ - --header "Accept: application/json"</code></pre> </div> + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..." \ + --data "{ + \"user_id\": \"expedita\", + \"name\": \"exercitationem\" +}" +</code></pre> </div> </div> </div> <div class="sl-bg-canvas-100 example-request example-request-javascript" @@ -1967,31 +15245,25 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <div class="sl-px-0 sl-py-1"> <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> <pre><code class="language-javascript">const url = new URL( - "https://vine.openfoodnetwork.org.au/api/v1/my-teams" + "https://vine.openfoodnetwork.org.au/api/v1/admin/user-personal-access-tokens" ); -const params = { - "cached": "1", - "page": "1", - "limit": "50", - "fields": "id,created_at", - "orderBy": "orderBy=id,desc", - "orderBy[]": "orderBy[]=id,desc&orderBy[]=created_at,asc", - "where": "where=id,like,*550e*", - "where[]": "where[]=id,like,*550e*&where[]=created_at,>=,2024-01-01", -}; -Object.keys(params) - .forEach(key => url.searchParams.append(key, params[key])); - const headers = { "Authorization": "Bearer {YOUR_API_TOKEN}", "Content-Type": "application/json", "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", +}; + +let body = { + "user_id": "expedita", + "name": "exercitationem" }; fetch(url, { - method: "GET", + method: "POST", headers, + body: JSON.stringify(body), }).then(response => response.json());</code></pre> </div> </div> </div> @@ -2000,24 +15272,19 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <div class="sl-px-0 sl-py-1"> <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> <pre><code class="language-php">$client = new \GuzzleHttp\Client(); -$url = 'https://vine.openfoodnetwork.org.au/api/v1/my-teams'; -$response = $client->get( +$url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/user-personal-access-tokens'; +$response = $client->post( $url, [ 'headers' => [ 'Authorization' => 'Bearer {YOUR_API_TOKEN}', 'Content-Type' => 'application/json', 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', ], - 'query' => [ - 'cached' => '1', - 'page' => '1', - 'limit' => '50', - 'fields' => 'id,created_at', - 'orderBy' => 'orderBy=id,desc', - 'orderBy[]' => 'orderBy[]=id,desc&orderBy[]=created_at,asc', - 'where' => 'where=id,like,*550e*', - 'where[]' => 'where[]=id,like,*550e*&where[]=created_at,>=,2024-01-01', + 'json' => [ + 'user_id' => 'expedita', + 'name' => 'exercitationem', ], ] ); @@ -2032,157 +15299,52 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <pre><code class="language-python">import requests import json -url = 'https://vine.openfoodnetwork.org.au/api/v1/my-teams' -params = { - 'cached': '1', - 'page': '1', - 'limit': '50', - 'fields': 'id,created_at', - 'orderBy': 'orderBy=id,desc', - 'orderBy[]': 'orderBy[]=id,desc&orderBy[]=created_at,asc', - 'where': 'where=id,like,*550e*', - 'where[]': 'where[]=id,like,*550e*&where[]=created_at,>=,2024-01-01', +url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/user-personal-access-tokens' +payload = { + "user_id": "expedita", + "name": "exercitationem" } headers = { 'Authorization': 'Bearer {YOUR_API_TOKEN}', 'Content-Type': 'application/json', - 'Accept': 'application/json' + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' } -response = requests.request('GET', url, headers=headers, params=params) +response = requests.request('POST', url, headers=headers, json=payload) response.json()</code></pre> </div> </div> </div> </div> - <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> - <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> - <div class="sl-flex sl-flex-1 sl-items-center sl-py-2"> - <div class="sl--ml-2"> - <div class="sl-h-sm sl-text-base sl-font-medium sl-px-1.5 sl-text-muted sl-rounded sl-border-transparent sl-border"> - <div class="sl-mb-2 sl-inline-block">Example response:</div> - <div class="sl-mb-2 sl-inline-block"> - <select - class="example-response-GETapi-v1-my-teams-toggle sl-text-base" - aria-label="Response sample" - onchange="switchExampleResponse('GETapi-v1-my-teams', event.target.value);"> - <option value="0">200</option> - </select></div> - </div> - </div> - </div> - <button type="button" - class="sl-button sl-h-sm sl-text-base sl-font-medium sl-px-1.5 hover:sl-bg-canvas-50 active:sl-bg-canvas-100 sl-text-muted hover:sl-text-body focus:sl-text-body sl-rounded sl-border-transparent sl-border disabled:sl-opacity-70"> - <div class="sl-mx-0"> - <svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="copy" - class="svg-inline--fa fa-copy fa-fw fa-sm sl-icon" role="img" - xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"> - <path fill="currentColor" - d="M384 96L384 0h-112c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48H464c26.51 0 48-21.49 48-48V128h-95.1C398.4 128 384 113.6 384 96zM416 0v96h96L416 0zM192 352V128h-144c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h192c26.51 0 48-21.49 48-48L288 416h-32C220.7 416 192 387.3 192 352z"></path> - </svg> - </div> - </button> - </div> - <div class="sl-panel__content-wrapper sl-bg-canvas-100 example-response-GETapi-v1-my-teams example-response-GETapi-v1-my-teams-0" - style=" " - > - <div class="sl-panel__content sl-p-0"> - <pre><code style="max-height: 300px;" - class="language-json sl-overflow-x-auto sl-overflow-y-auto">{ - "meta": { - "responseCode": 200, - "limit": 50, - "offset": 0, - "message": "", - "cached": false, - "availableRelations": [] - }, - "data": { - "current_page": 1, - "data": [ - { - "id": 1, - "name": "Team A", - "created_at": "2024-08-16T06:54:28.000000Z", - "updated_at": "2024-08-16T06:54:28.000000Z", - "deleted_at": null - }, - { - "id": 2, - "name": "Team B", - "created_at": "2024-08-16T06:54:29.000000Z", - "updated_at": "2024-08-16T06:54:29.000000Z", - "deleted_at": null - } - ], - "first_page_url": "https://vine.openfoodnetwork.org.au/api/v1/my-teams?page=1", - "from": 1, - "last_page": 1, - "last_page_url": "https://vine.openfoodnetwork.org.au/api/v1/my-teams?page=1", - "links": [ - { - "url": null, - "label": "&laquo; Previous", - "active": false - }, - { - "url": "https://vine.openfoodnetwork.org.au/api/v1/my-teams?page=1", - "label": "1", - "active": true - }, - { - "url": null, - "label": "Next &raquo;", - "active": false - } - ], - "next_page_url": null, - "path": "https://vine.openfoodnetwork.org.au/api/v1/my-teams", - "per_page": 50, - "prev_page_url": null, - "to": 2, - "total": 2 - } -}</code></pre> - </div> - </div> - </div> </div> </div> </div> - <h1 id="shops" - class="sl-text-5xl sl-leading-tight sl-font-prose sl-text-heading" - > - /shops - </h1> - - <p>API for managing shops</p> - - <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> <div class="sl-relative"> <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" - id="shops-POSTapi-v1-shops"> - POST / + id="endpoints-GETapi-v1-admin-user-personal-access-tokens--user_personal_access_token-"> + GET / {id} </h2> </div> </div> <div class="sl-relative"> - <div title="https://vine.openfoodnetwork.org.au/api/v1/shops" + <div title="https://vine.openfoodnetwork.org.au/api/v1/admin/user-personal-access-tokens/{user_personal_access_token}" class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" > <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" - style="background-color: black;" + style="background-color: green;" > - POST + GET </div> <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> <div dir="rtl" class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> - <div class="sl-flex-1 sl-font-semibold">/api/v1/shops</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/admin/user-personal-access-tokens/{user_personal_access_token}</div> </div> <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" @@ -2192,7 +15354,7 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw </div> </div> - <p>Create a new shop.</p> + </div> <div class="sl-flex"> <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> @@ -2257,74 +15419,37 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw </div> </div> </div> - </div> - </div> - - - - - <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> - <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">Body Parameters</h3> - - <div class="sl-text-sm"> - <div class="expandable sl-text-sm sl-border-l sl-ml-px"> - <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> - <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> - <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> - <div class="sl-flex sl-items-center sl-max-w-full"> - <div class="sl-flex sl-items-baseline sl-text-base"> - <div class="sl-font-mono sl-font-semibold sl-mr-2">shop_name</div> - <span class="sl-truncate sl-text-muted">string</span> - </div> - <div class="sl-flex-1 sl-h-px sl-mx-3"></div> - <span class="sl-ml-2 sl-text-warning">required</span> - </div> - <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> - <span>Example:</span> <!-- <span> important for spacing --> - <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> - <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> - saepe - </div> - </div> - </div> - </div> -</div> - - </div> - <div class="expandable sl-text-sm sl-border-l sl-ml-px"> - <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> <div class="sl-flex sl-items-center sl-max-w-full"> <div class="sl-flex sl-items-baseline sl-text-base"> - <div class="sl-font-mono sl-font-semibold sl-mr-2">user_email</div> - <span class="sl-truncate sl-text-muted">string</span> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> </div> - <div class="sl-flex-1 sl-h-px sl-mx-3"></div> - <span class="sl-ml-2 sl-text-warning">required</span> </div> - <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> - <p>Must be a valid email address.</p> - </div> <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> <span>Example:</span> <!-- <span> important for spacing --> <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> - destiny58@example.net + JWT eyJ0eXAiOiJKV... </div> </div> </div> </div> </div> + </div> + </div> + + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">URL Parameters</h3> - </div> - <div class="expandable sl-text-sm sl-border-l sl-ml-px"> - <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> <div class="sl-flex sl-items-center sl-max-w-full"> <div class="sl-flex sl-items-baseline sl-text-base"> - <div class="sl-font-mono sl-font-semibold sl-mr-2">user_name</div> + <div class="sl-font-mono sl-font-semibold sl-mr-2">user_personal_access_token</div> <span class="sl-truncate sl-text-muted">string</span> </div> <div class="sl-flex-1 sl-h-px sl-mx-3"></div> @@ -2334,17 +15459,18 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <span>Example:</span> <!-- <span> important for spacing --> <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> - amet + perspiciatis </div> </div> </div> </div> </div> - - </div> - </div> + </div> </div> + + + </div> </div> </div> @@ -2373,17 +15499,12 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw style=""> <div class="sl-px-0 sl-py-1"> <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> - <pre><code class="language-bash">curl --request POST \ - "https://vine.openfoodnetwork.org.au/api/v1/shops" \ + <pre><code class="language-bash">curl --request GET \ + --get "https://vine.openfoodnetwork.org.au/api/v1/admin/user-personal-access-tokens/perspiciatis" \ --header "Authorization: Bearer {YOUR_API_TOKEN}" \ --header "Content-Type: application/json" \ --header "Accept: application/json" \ - --data "{ - \"shop_name\": \"saepe\", - \"user_email\": \"destiny58@example.net\", - \"user_name\": \"amet\" -}" -</code></pre> </div> + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..."</code></pre> </div> </div> </div> <div class="sl-bg-canvas-100 example-request example-request-javascript" @@ -2391,25 +15512,19 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <div class="sl-px-0 sl-py-1"> <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> <pre><code class="language-javascript">const url = new URL( - "https://vine.openfoodnetwork.org.au/api/v1/shops" + "https://vine.openfoodnetwork.org.au/api/v1/admin/user-personal-access-tokens/perspiciatis" ); const headers = { "Authorization": "Bearer {YOUR_API_TOKEN}", "Content-Type": "application/json", "Accept": "application/json", -}; - -let body = { - "shop_name": "saepe", - "user_email": "destiny58@example.net", - "user_name": "amet" + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", }; fetch(url, { - method: "POST", + method: "GET", headers, - body: JSON.stringify(body), }).then(response => response.json());</code></pre> </div> </div> </div> @@ -2418,19 +15533,15 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <div class="sl-px-0 sl-py-1"> <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> <pre><code class="language-php">$client = new \GuzzleHttp\Client(); -$url = 'https://vine.openfoodnetwork.org.au/api/v1/shops'; -$response = $client->post( +$url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/user-personal-access-tokens/perspiciatis'; +$response = $client->get( $url, [ 'headers' => [ 'Authorization' => 'Bearer {YOUR_API_TOKEN}', 'Content-Type' => 'application/json', 'Accept' => 'application/json', - ], - 'json' => [ - 'shop_name' => 'saepe', - 'user_email' => 'destiny58@example.net', - 'user_name' => 'amet', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', ], ] ); @@ -2445,19 +15556,15 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <pre><code class="language-python">import requests import json -url = 'https://vine.openfoodnetwork.org.au/api/v1/shops' -payload = { - "shop_name": "saepe", - "user_email": "destiny58@example.net", - "user_name": "amet" -} +url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/user-personal-access-tokens/perspiciatis' headers = { 'Authorization': 'Bearer {YOUR_API_TOKEN}', 'Content-Type': 'application/json', - 'Accept': 'application/json' + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' } -response = requests.request('POST', url, headers=headers, json=payload) +response = requests.request('GET', url, headers=headers) response.json()</code></pre> </div> </div> </div> @@ -2471,10 +15578,10 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <div class="sl-mb-2 sl-inline-block">Example response:</div> <div class="sl-mb-2 sl-inline-block"> <select - class="example-response-POSTapi-v1-shops-toggle sl-text-base" + class="example-response-GETapi-v1-admin-user-personal-access-tokens--user_personal_access_token--toggle sl-text-base" aria-label="Response sample" - onchange="switchExampleResponse('POSTapi-v1-shops', event.target.value);"> - <option value="0">200</option> + onchange="switchExampleResponse('GETapi-v1-admin-user-personal-access-tokens--user_personal_access_token-', event.target.value);"> + <option value="0">401</option> </select></div> </div> </div> @@ -2491,23 +15598,37 @@ class="svg-inline--fa fa-copy fa-fw fa-sm sl-icon" role="img" </div> </button> </div> - <div class="sl-panel__content-wrapper sl-bg-canvas-100 example-response-POSTapi-v1-shops example-response-POSTapi-v1-shops-0" + <div class="sl-panel__content-wrapper sl-bg-canvas-100 example-response-GETapi-v1-admin-user-personal-access-tokens--user_personal_access_token- example-response-GETapi-v1-admin-user-personal-access-tokens--user_personal_access_token--0" style=" " > - <div class="sl-panel__content sl-p-0"> + <div class="sl-panel__content sl-p-0"> <details class="sl-pl-2"> + <summary style="cursor: pointer; list-style: none;"> + <small> + <span class="expansion-chevrons"> + + <svg aria-hidden="true" focusable="false" data-prefix="fas" + data-icon="chevron-right" + class="svg-inline--fa fa-chevron-right fa-fw sl-icon sl-text-muted" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"> + <path fill="currentColor" + d="M96 480c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L242.8 256L73.38 86.63c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l192 192c12.5 12.5 12.5 32.75 0 45.25l-192 192C112.4 476.9 104.2 480 96 480z"></path> + </svg> + </span> + Headers + </small> + </summary> + <pre><code class="language-http"> cache-control + : no-cache, private + content-type + : application/json + access-control-allow-origin + : * + </code></pre> + </details> + <pre><code style="max-height: 300px;" class="language-json sl-overflow-x-auto sl-overflow-y-auto">{ - "meta": { - "responseCode": 200, - "limit": 50, - "offset": 0, - "message": "Saved. Here is the API Token for the user linked to this new team. It will only be displayed ONCE, so please store it in a secure manner.", - "cached": false, - "availableRelations": [] - }, - "data": { - "token": "123|kjfhsgiufsghkjsfghkfgsjh" - } + "message": "Unauthenticated." }</code></pre> </div> </div> @@ -2516,38 +15637,35 @@ class="language-json sl-overflow-x-auto sl-overflow-y-auto">{ </div> </div> - <h1 id="system-statistics" - class="sl-text-5xl sl-leading-tight sl-font-prose sl-text-heading" - > - /system-statistics - </h1> - - <p>Check out some Vine platform statistics.</p> - - <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> <div class="sl-relative"> <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" - id="system-statistics-GETapi-v1-system-statistics"> - GET / + id="endpoints-PUTapi-v1-admin-user-personal-access-tokens--user_personal_access_token-"> + PUT/ {id} </h2> </div> </div> <div class="sl-relative"> - <div title="https://vine.openfoodnetwork.org.au/api/v1/system-statistics" + <div title="https://vine.openfoodnetwork.org.au/api/v1/admin/user-personal-access-tokens/{user_personal_access_token}" class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" > <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" - style="background-color: green;" + style="background-color: darkblue;" > - GET + PUT + </div> + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: purple;" + > + PATCH </div> <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> <div dir="rtl" class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> - <div class="sl-flex-1 sl-font-semibold">/api/v1/system-statistics</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/admin/user-personal-access-tokens/{user_personal_access_token}</div> </div> <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" @@ -2557,7 +15675,7 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw </div> </div> - <p>Retrieve system statistics.</p> + </div> <div class="sl-flex"> <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> @@ -2622,194 +15740,310 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw </div> </div> </div> - </div> - </div> - - - - <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> - <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">Query Parameters</h3> - - <div class="sl-text-sm"> - <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> <div class="sl-flex sl-items-center sl-max-w-full"> <div class="sl-flex sl-items-baseline sl-text-base"> - <div class="sl-font-mono sl-font-semibold sl-mr-2">cached</div> - <span class="sl-truncate sl-text-muted">boolean</span> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> </div> </div> - <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> - <p>Request the response to be cached. Default: <code>true</code>.</p> - </div> <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> <span>Example:</span> <!-- <span> important for spacing --> <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> - 1 + JWT eyJ0eXAiOiJKV... </div> </div> </div> </div> </div> - <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + </div> + </div> + + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">URL Parameters</h3> + + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> <div class="sl-flex sl-items-center sl-max-w-full"> <div class="sl-flex sl-items-baseline sl-text-base"> - <div class="sl-font-mono sl-font-semibold sl-mr-2">page</div> - <span class="sl-truncate sl-text-muted">integer</span> + <div class="sl-font-mono sl-font-semibold sl-mr-2">user_personal_access_token</div> + <span class="sl-truncate sl-text-muted">string</span> </div> + <div class="sl-flex-1 sl-h-px sl-mx-3"></div> + <span class="sl-ml-2 sl-text-warning">required</span> </div> - <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> - <p>The pagination page number.</p> - </div> <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> <span>Example:</span> <!-- <span> important for spacing --> <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> - 1 + accusamus + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + + + </div> + </div> + </div> + + <div data-testid="two-column-right" class="sl-relative sl-w-2/5 sl-ml-16" style="max-width: 500px;"> + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + + + <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> + <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> + <div class="sl-flex sl-flex-1 sl-items-center sl-h-lg"> + <div class="sl--ml-2"> + Example request: + <select class="example-request-lang-toggle sl-text-base" + aria-label="Request Sample Language" + onchange="switchExampleLanguage(event.target.value);"> + <option>bash</option> + <option>javascript</option> + <option>php</option> + <option>python</option> + </select> + </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-bash" + style=""> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-bash">curl --request PUT \ + "https://vine.openfoodnetwork.org.au/api/v1/admin/user-personal-access-tokens/accusamus" \ + --header "Authorization: Bearer {YOUR_API_TOKEN}" \ + --header "Content-Type: application/json" \ + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..."</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-javascript" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-javascript">const url = new URL( + "https://vine.openfoodnetwork.org.au/api/v1/admin/user-personal-access-tokens/accusamus" +); + +const headers = { + "Authorization": "Bearer {YOUR_API_TOKEN}", + "Content-Type": "application/json", + "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", +}; + +fetch(url, { + method: "PUT", + headers, +}).then(response => response.json());</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-php" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-php">$client = new \GuzzleHttp\Client(); +$url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/user-personal-access-tokens/accusamus'; +$response = $client->put( + $url, + [ + 'headers' => [ + 'Authorization' => 'Bearer {YOUR_API_TOKEN}', + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', + ], + ] +); +$body = $response->getBody(); +print_r(json_decode((string) $body));</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-python" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-python">import requests +import json + +url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/user-personal-access-tokens/accusamus' +headers = { + 'Authorization': 'Bearer {YOUR_API_TOKEN}', + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' +} + +response = requests.request('PUT', url, headers=headers) +response.json()</code></pre> </div> + </div> + </div> + </div> + + </div> + </div> +</div> + + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-relative"> + <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> + <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" + id="endpoints-DELETEapi-v1-admin-user-personal-access-tokens--user_personal_access_token-"> + DELETE / {id} + </h2> + </div> + </div> + + <div class="sl-relative"> + <div title="https://vine.openfoodnetwork.org.au/api/v1/admin/user-personal-access-tokens/{user_personal_access_token}" + class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" + > + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: red;" + > + DELETE + </div> + <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> + <div dir="rtl" + class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/admin/user-personal-access-tokens/{user_personal_access_token}</div> </div> - </div> - </div> - </div> -</div> - <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> - <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> - <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> - <div class="sl-flex sl-items-center sl-max-w-full"> - <div class="sl-flex sl-items-baseline sl-text-base"> - <div class="sl-font-mono sl-font-semibold sl-mr-2">limit</div> - <span class="sl-truncate sl-text-muted">integer</span> - </div> + + <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" + style="background-color: darkred" + >requires authentication + </div> </div> - <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> - <p>The number of entries returned per pagination page.</p> </div> - <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> - <span>Example:</span> <!-- <span> important for spacing --> - <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> - <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> - 50 - </div> - </div> - </div> - </div> -</div> - <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + + + </div> + <div class="sl-flex"> + <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> + <div class="sl-stack sl-stack--vertical sl-stack--10 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--8 sl-flex sl-flex-col sl-items-stretch"> + <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose"> + Headers + </h3> + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> <div class="sl-flex sl-items-center sl-max-w-full"> <div class="sl-flex sl-items-baseline sl-text-base"> - <div class="sl-font-mono sl-font-semibold sl-mr-2">fields</div> - <span class="sl-truncate sl-text-muted">string</span> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Authorization</div> </div> </div> - <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> - <p>Comma-separated list of database fields to return within the object.</p> - </div> <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> <span>Example:</span> <!-- <span> important for spacing --> <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> - id,sum_voucher_value_total + Bearer {YOUR_API_TOKEN} </div> </div> </div> </div> </div> - <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> <div class="sl-flex sl-items-center sl-max-w-full"> <div class="sl-flex sl-items-baseline sl-text-base"> - <div class="sl-font-mono sl-font-semibold sl-mr-2">orderBy</div> - <span class="sl-truncate sl-text-muted">comma-separated</span> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> </div> </div> - <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> - <p>Order the data by a given field. Comma-separated string.</p> - </div> <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> <span>Example:</span> <!-- <span> important for spacing --> <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> - orderBy=sum_voucher_value_total,desc + application/json </div> </div> </div> </div> </div> - <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> <div class="sl-flex sl-items-center sl-max-w-full"> <div class="sl-flex sl-items-baseline sl-text-base"> - <div class="sl-font-mono sl-font-semibold sl-mr-2">orderBy[]</div> - <span class="sl-truncate sl-text-muted">comma-separated</span> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> </div> </div> - <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> - <p>Compound <code>orderBy</code>. Order the data by a given field. Comma-separated string. Can not be used in conjunction as standard <code>orderBy</code>.</p> - </div> <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> <span>Example:</span> <!-- <span> important for spacing --> <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> - orderBy[]=id,desc&orderBy[]=created_at,asc + application/json </div> </div> </div> </div> </div> - <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> <div class="sl-flex sl-items-center sl-max-w-full"> <div class="sl-flex sl-items-baseline sl-text-base"> - <div class="sl-font-mono sl-font-semibold sl-mr-2">where</div> - <span class="sl-truncate sl-text-muted">comma-separated</span> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> </div> </div> - <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> - <p>Filter the request on a single field. Key-Value or Key-Operator-Value comma-separated string.</p> - </div> <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> <span>Example:</span> <!-- <span> important for spacing --> <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> - where=id,>,123 + JWT eyJ0eXAiOiJKV... </div> </div> </div> </div> </div> - <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + </div> + </div> + + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">URL Parameters</h3> + + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> <div class="sl-flex sl-items-center sl-max-w-full"> <div class="sl-flex sl-items-baseline sl-text-base"> - <div class="sl-font-mono sl-font-semibold sl-mr-2">where[]</div> - <span class="sl-truncate sl-text-muted">comma-separated</span> + <div class="sl-font-mono sl-font-semibold sl-mr-2">user_personal_access_token</div> + <span class="sl-truncate sl-text-muted">string</span> </div> + <div class="sl-flex-1 sl-h-px sl-mx-3"></div> + <span class="sl-ml-2 sl-text-warning">required</span> </div> - <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> - <p>Compound <code>where</code>. Use when you need to filter on multiple <code>where</code>'s. Note only AND is possible; ORWHERE is not available.</p> - </div> <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> <span>Example:</span> <!-- <span> important for spacing --> <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> - where[]=id,like,*550e*&where[]=created_at,>=,2024-01-01 + dicta </div> </div> </div> </div> </div> - </div> + </div> </div> + + </div> </div> @@ -2839,11 +16073,12 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw style=""> <div class="sl-px-0 sl-py-1"> <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> - <pre><code class="language-bash">curl --request GET \ - --get "https://vine.openfoodnetwork.org.au/api/v1/system-statistics?cached=1&page=1&limit=50&fields=id%2Csum_voucher_value_total&orderBy=orderBy%3Dsum_voucher_value_total%2Cdesc&orderBy%5B%5D=orderBy%5B%5D%3Did%2Cdesc%26orderBy%5B%5D%3Dcreated_at%2Casc&where=where%3Did%2C%3E%2C123&where%5B%5D=where%5B%5D%3Did%2Clike%2C%2A550e%2A%26where%5B%5D%3Dcreated_at%2C%3E%3D%2C2024-01-01" \ + <pre><code class="language-bash">curl --request DELETE \ + "https://vine.openfoodnetwork.org.au/api/v1/admin/user-personal-access-tokens/dicta" \ --header "Authorization: Bearer {YOUR_API_TOKEN}" \ --header "Content-Type: application/json" \ - --header "Accept: application/json"</code></pre> </div> + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..."</code></pre> </div> </div> </div> <div class="sl-bg-canvas-100 example-request example-request-javascript" @@ -2851,30 +16086,18 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <div class="sl-px-0 sl-py-1"> <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> <pre><code class="language-javascript">const url = new URL( - "https://vine.openfoodnetwork.org.au/api/v1/system-statistics" + "https://vine.openfoodnetwork.org.au/api/v1/admin/user-personal-access-tokens/dicta" ); -const params = { - "cached": "1", - "page": "1", - "limit": "50", - "fields": "id,sum_voucher_value_total", - "orderBy": "orderBy=sum_voucher_value_total,desc", - "orderBy[]": "orderBy[]=id,desc&orderBy[]=created_at,asc", - "where": "where=id,>,123", - "where[]": "where[]=id,like,*550e*&where[]=created_at,>=,2024-01-01", -}; -Object.keys(params) - .forEach(key => url.searchParams.append(key, params[key])); - const headers = { "Authorization": "Bearer {YOUR_API_TOKEN}", "Content-Type": "application/json", "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", }; fetch(url, { - method: "GET", + method: "DELETE", headers, }).then(response => response.json());</code></pre> </div> </div> @@ -2884,143 +16107,43 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <div class="sl-px-0 sl-py-1"> <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> <pre><code class="language-php">$client = new \GuzzleHttp\Client(); -$url = 'https://vine.openfoodnetwork.org.au/api/v1/system-statistics'; -$response = $client->get( +$url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/user-personal-access-tokens/dicta'; +$response = $client->delete( $url, [ 'headers' => [ 'Authorization' => 'Bearer {YOUR_API_TOKEN}', 'Content-Type' => 'application/json', 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', ], - 'query' => [ - 'cached' => '1', - 'page' => '1', - 'limit' => '50', - 'fields' => 'id,sum_voucher_value_total', - 'orderBy' => 'orderBy=sum_voucher_value_total,desc', - 'orderBy[]' => 'orderBy[]=id,desc&orderBy[]=created_at,asc', - 'where' => 'where=id,>,123', - 'where[]' => 'where[]=id,like,*550e*&where[]=created_at,>=,2024-01-01', - ], - ] -); -$body = $response->getBody(); -print_r(json_decode((string) $body));</code></pre> </div> - </div> - </div> - <div class="sl-bg-canvas-100 example-request example-request-python" - style="display: none;"> - <div class="sl-px-0 sl-py-1"> - <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> - <pre><code class="language-python">import requests -import json - -url = 'https://vine.openfoodnetwork.org.au/api/v1/system-statistics' -params = { - 'cached': '1', - 'page': '1', - 'limit': '50', - 'fields': 'id,sum_voucher_value_total', - 'orderBy': 'orderBy=sum_voucher_value_total,desc', - 'orderBy[]': 'orderBy[]=id,desc&orderBy[]=created_at,asc', - 'where': 'where=id,>,123', - 'where[]': 'where[]=id,like,*550e*&where[]=created_at,>=,2024-01-01', -} -headers = { - 'Authorization': 'Bearer {YOUR_API_TOKEN}', - 'Content-Type': 'application/json', - 'Accept': 'application/json' -} - -response = requests.request('GET', url, headers=headers, params=params) -response.json()</code></pre> </div> - </div> - </div> - </div> - - <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> - <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> - <div class="sl-flex sl-flex-1 sl-items-center sl-py-2"> - <div class="sl--ml-2"> - <div class="sl-h-sm sl-text-base sl-font-medium sl-px-1.5 sl-text-muted sl-rounded sl-border-transparent sl-border"> - <div class="sl-mb-2 sl-inline-block">Example response:</div> - <div class="sl-mb-2 sl-inline-block"> - <select - class="example-response-GETapi-v1-system-statistics-toggle sl-text-base" - aria-label="Response sample" - onchange="switchExampleResponse('GETapi-v1-system-statistics', event.target.value);"> - <option value="0">200</option> - </select></div> - </div> - </div> - </div> - <button type="button" - class="sl-button sl-h-sm sl-text-base sl-font-medium sl-px-1.5 hover:sl-bg-canvas-50 active:sl-bg-canvas-100 sl-text-muted hover:sl-text-body focus:sl-text-body sl-rounded sl-border-transparent sl-border disabled:sl-opacity-70"> - <div class="sl-mx-0"> - <svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="copy" - class="svg-inline--fa fa-copy fa-fw fa-sm sl-icon" role="img" - xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"> - <path fill="currentColor" - d="M384 96L384 0h-112c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48H464c26.51 0 48-21.49 48-48V128h-95.1C398.4 128 384 113.6 384 96zM416 0v96h96L416 0zM192 352V128h-144c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h192c26.51 0 48-21.49 48-48L288 416h-32C220.7 416 192 387.3 192 352z"></path> - </svg> - </div> - </button> - </div> - <div class="sl-panel__content-wrapper sl-bg-canvas-100 example-response-GETapi-v1-system-statistics example-response-GETapi-v1-system-statistics-0" - style=" " - > - <div class="sl-panel__content sl-p-0"> - <pre><code style="max-height: 300px;" - class="language-json sl-overflow-x-auto sl-overflow-y-auto">{ - "meta": { - "responseCode": 200, - "limit": 50, - "offset": 0, - "message": "", - "cached": false, - "availableRelations": [] - }, - "data": { - "current_page": 1, - "data": [ - { - "id": "550e8400-e29b-41d4-a716-446655440000", - "created_at": "2024-01-01 00:00:00" - } - ], - "first_page_url": "https://open-food-network-vouchers.test/api/v1/admin/system-statistics?page=1", - "from": null, - "last_page": 1, - "last_page_url": "https://open-food-network-vouchers.test/api/v1/admin/system-statistics?page=1", - "links": [ - { - "url": null, - "label": "&laquo; Previous", - "active": false - }, - { - "url": "https://open-food-network-vouchers.test/api/v1/admin/system-statistics?page=1", - "label": "1", - "active": true - }, - { - "url": null, - "label": "Next &raquo;", - "active": false - } - ], - "next_page_url": null, - "path": "https://open-food-network-vouchers.test/api/v1/admin/system-statistics", - "per_page": 1, - "prev_page_url": null, - "to": null, - "total": 0 - } -}</code></pre> - </div> + ] +); +$body = $response->getBody(); +print_r(json_decode((string) $body));</code></pre> </div> + </div> + </div> + <div class="sl-bg-canvas-100 example-request example-request-python" + style="display: none;"> + <div class="sl-px-0 sl-py-1"> + <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> + <pre><code class="language-python">import requests +import json + +url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/user-personal-access-tokens/dicta' +headers = { + 'Authorization': 'Bearer {YOUR_API_TOKEN}', + 'Content-Type': 'application/json', + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' +} + +response = requests.request('DELETE', url, headers=headers) +response.json()</code></pre> </div> + </div> </div> </div> + </div> </div> </div> @@ -3030,14 +16153,14 @@ class="language-json sl-overflow-x-auto sl-overflow-y-auto">{ <div class="sl-relative"> <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" - id="system-statistics-GETapi-v1-system-statistics--id-"> - GET /{id} + id="endpoints-GETapi-v1-admin-users"> + GET / </h2> </div> </div> <div class="sl-relative"> - <div title="https://vine.openfoodnetwork.org.au/api/v1/system-statistics/{id}" + <div title="https://vine.openfoodnetwork.org.au/api/v1/admin/users" class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" > <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" @@ -3048,7 +16171,7 @@ class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-i <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> <div dir="rtl" class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> - <div class="sl-flex-1 sl-font-semibold">/api/v1/system-statistics/{id}</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/admin/users</div> </div> <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" @@ -3058,7 +16181,7 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw </div> </div> - <p>Retrieve a single system statistic based on ID.</p> + </div> <div class="sl-flex"> <div data-testid="two-column-left" class="sl-flex-1 sl-w-0"> @@ -3123,32 +16246,19 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw </div> </div> </div> - </div> - </div> - - <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> - <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">URL Parameters</h3> - - <div class="sl-text-sm"> <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> <div class="sl-flex sl-items-center sl-max-w-full"> <div class="sl-flex sl-items-baseline sl-text-base"> - <div class="sl-font-mono sl-font-semibold sl-mr-2">id</div> - <span class="sl-truncate sl-text-muted">integer</span> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> </div> - <div class="sl-flex-1 sl-h-px sl-mx-3"></div> - <span class="sl-ml-2 sl-text-warning">required</span> </div> - <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> - <p>ID.</p> - </div> <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> <span>Example:</span> <!-- <span> important for spacing --> <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> - 7 + JWT eyJ0eXAiOiJKV... </div> </div> </div> @@ -3157,57 +16267,8 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw </div> </div> + - <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> - <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">Query Parameters</h3> - - <div class="sl-text-sm"> - <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> - <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> - <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> - <div class="sl-flex sl-items-center sl-max-w-full"> - <div class="sl-flex sl-items-baseline sl-text-base"> - <div class="sl-font-mono sl-font-semibold sl-mr-2">cached</div> - <span class="sl-truncate sl-text-muted">boolean</span> - </div> - </div> - <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> - <p>Request the response to be cached. Default: <code>true</code>.</p> - </div> - <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> - <span>Example:</span> <!-- <span> important for spacing --> - <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> - <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> - 1 - </div> - </div> - </div> - </div> -</div> - <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> - <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> - <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> - <div class="sl-flex sl-items-center sl-max-w-full"> - <div class="sl-flex sl-items-baseline sl-text-base"> - <div class="sl-font-mono sl-font-semibold sl-mr-2">fields</div> - <span class="sl-truncate sl-text-muted">string</span> - </div> - </div> - <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> - <p>Comma-separated list of database fields to return within the object.</p> - </div> - <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> - <span>Example:</span> <!-- <span> important for spacing --> - <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> - <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> - id,num_users - </div> - </div> - </div> - </div> -</div> - </div> - </div> </div> @@ -3239,10 +16300,11 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <div class="sl-px-0 sl-py-1"> <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> <pre><code class="language-bash">curl --request GET \ - --get "https://vine.openfoodnetwork.org.au/api/v1/system-statistics/7?cached=1&fields=id%2Cnum_users" \ + --get "https://vine.openfoodnetwork.org.au/api/v1/admin/users" \ --header "Authorization: Bearer {YOUR_API_TOKEN}" \ --header "Content-Type: application/json" \ - --header "Accept: application/json"</code></pre> </div> + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..."</code></pre> </div> </div> </div> <div class="sl-bg-canvas-100 example-request example-request-javascript" @@ -3250,20 +16312,14 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <div class="sl-px-0 sl-py-1"> <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> <pre><code class="language-javascript">const url = new URL( - "https://vine.openfoodnetwork.org.au/api/v1/system-statistics/7" + "https://vine.openfoodnetwork.org.au/api/v1/admin/users" ); -const params = { - "cached": "1", - "fields": "id,num_users", -}; -Object.keys(params) - .forEach(key => url.searchParams.append(key, params[key])); - const headers = { "Authorization": "Bearer {YOUR_API_TOKEN}", "Content-Type": "application/json", "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", }; fetch(url, { @@ -3277,7 +16333,7 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <div class="sl-px-0 sl-py-1"> <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> <pre><code class="language-php">$client = new \GuzzleHttp\Client(); -$url = 'https://vine.openfoodnetwork.org.au/api/v1/system-statistics/7'; +$url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/users'; $response = $client->get( $url, [ @@ -3285,10 +16341,7 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw 'Authorization' => 'Bearer {YOUR_API_TOKEN}', 'Content-Type' => 'application/json', 'Accept' => 'application/json', - ], - 'query' => [ - 'cached' => '1', - 'fields' => 'id,num_users', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', ], ] ); @@ -3303,18 +16356,15 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <pre><code class="language-python">import requests import json -url = 'https://vine.openfoodnetwork.org.au/api/v1/system-statistics/7' -params = { - 'cached': '1', - 'fields': 'id,num_users', -} +url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/users' headers = { 'Authorization': 'Bearer {YOUR_API_TOKEN}', 'Content-Type': 'application/json', - 'Accept': 'application/json' + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' } -response = requests.request('GET', url, headers=headers, params=params) +response = requests.request('GET', url, headers=headers) response.json()</code></pre> </div> </div> </div> @@ -3328,10 +16378,10 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <div class="sl-mb-2 sl-inline-block">Example response:</div> <div class="sl-mb-2 sl-inline-block"> <select - class="example-response-GETapi-v1-system-statistics--id--toggle sl-text-base" + class="example-response-GETapi-v1-admin-users-toggle sl-text-base" aria-label="Response sample" - onchange="switchExampleResponse('GETapi-v1-system-statistics--id-', event.target.value);"> - <option value="0">200</option> + onchange="switchExampleResponse('GETapi-v1-admin-users', event.target.value);"> + <option value="0">401</option> </select></div> </div> </div> @@ -3348,34 +16398,37 @@ class="svg-inline--fa fa-copy fa-fw fa-sm sl-icon" role="img" </div> </button> </div> - <div class="sl-panel__content-wrapper sl-bg-canvas-100 example-response-GETapi-v1-system-statistics--id- example-response-GETapi-v1-system-statistics--id--0" + <div class="sl-panel__content-wrapper sl-bg-canvas-100 example-response-GETapi-v1-admin-users example-response-GETapi-v1-admin-users-0" style=" " > - <div class="sl-panel__content sl-p-0"> + <div class="sl-panel__content sl-p-0"> <details class="sl-pl-2"> + <summary style="cursor: pointer; list-style: none;"> + <small> + <span class="expansion-chevrons"> + + <svg aria-hidden="true" focusable="false" data-prefix="fas" + data-icon="chevron-right" + class="svg-inline--fa fa-chevron-right fa-fw sl-icon sl-text-muted" + xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"> + <path fill="currentColor" + d="M96 480c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L242.8 256L73.38 86.63c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l192 192c12.5 12.5 12.5 32.75 0 45.25l-192 192C112.4 476.9 104.2 480 96 480z"></path> + </svg> + </span> + Headers + </small> + </summary> + <pre><code class="language-http"> cache-control + : no-cache, private + content-type + : application/json + access-control-allow-origin + : * + </code></pre> + </details> + <pre><code style="max-height: 300px;" class="language-json sl-overflow-x-auto sl-overflow-y-auto">{ - "meta": { - "responseCode": 200, - "limit": 50, - "offset": 0, - "message": "", - "cached": true, - "cached_at": "2024-08-13 08:58:19", - "availableRelations": [] - }, - "data": { - "id": 1, - "num_users": 3, - "num_teams": 2, - "num_voucher_sets": 0, - "num_vouchers": 0, - "num_voucher_redemptions": 0, - "sum_voucher_value_total": 0, - "sum_voucher_value_redeemed": 0, - "sum_voucher_value_remaining": 0, - "created_at": "2024-08-13T07:56:17.000000Z", - "updated_at": "2024-08-13T07:56:17.000000Z" - } + "message": "Unauthenticated." }</code></pre> </div> </div> @@ -3384,27 +16437,19 @@ class="language-json sl-overflow-x-auto sl-overflow-y-auto">{ </div> </div> - <h1 id="endpoints" - class="sl-text-5xl sl-leading-tight sl-font-prose sl-text-heading" - > - Endpoints - </h1> - - - - <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> + <div class="sl-stack sl-stack--vertical sl-stack--8 HttpOperation sl-flex sl-flex-col sl-items-stretch sl-w-full"> <div class="sl-stack sl-stack--vertical sl-stack--5 sl-flex sl-flex-col sl-items-stretch"> <div class="sl-relative"> <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" - id="endpoints-POSTapi-v1-my-team-audit-items"> + id="endpoints-POSTapi-v1-admin-users"> POST / </h2> </div> </div> <div class="sl-relative"> - <div title="https://vine.openfoodnetwork.org.au/api/v1/my-team-audit-items" + <div title="https://vine.openfoodnetwork.org.au/api/v1/admin/users" class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" > <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" @@ -3415,7 +16460,7 @@ class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-i <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> <div dir="rtl" class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> - <div class="sl-flex-1 sl-font-semibold">/api/v1/my-team-audit-items</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/admin/users</div> </div> <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" @@ -3441,61 +16486,158 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> <div class="sl-flex sl-items-center sl-max-w-full"> <div class="sl-flex sl-items-baseline sl-text-base"> - <div class="sl-font-mono sl-font-semibold sl-mr-2">Authorization</div> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Authorization</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + Bearer {YOUR_API_TOKEN} + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + application/json + </div> + </div> + </div> + </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + JWT eyJ0eXAiOiJKV... + </div> + </div> + </div> + </div> +</div> + </div> + </div> + + + + + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">Body Parameters</h3> + + <div class="sl-text-sm"> + <div class="expandable sl-text-sm sl-border-l sl-ml-px"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">name</div> + <span class="sl-truncate sl-text-muted">string</span> </div> + <div class="sl-flex-1 sl-h-px sl-mx-3"></div> + <span class="sl-ml-2 sl-text-warning">required</span> </div> <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> <span>Example:</span> <!-- <span> important for spacing --> <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> - Bearer {YOUR_API_TOKEN} + voluptatem </div> </div> </div> </div> </div> - <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + + </div> + <div class="expandable sl-text-sm sl-border-l sl-ml-px"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> <div class="sl-flex sl-items-center sl-max-w-full"> <div class="sl-flex sl-items-baseline sl-text-base"> - <div class="sl-font-mono sl-font-semibold sl-mr-2">Content-Type</div> + <div class="sl-font-mono sl-font-semibold sl-mr-2">email</div> + <span class="sl-truncate sl-text-muted">string</span> </div> + <div class="sl-flex-1 sl-h-px sl-mx-3"></div> + <span class="sl-ml-2 sl-text-warning">required</span> </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>Must be a valid email address.</p> + </div> <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> <span>Example:</span> <!-- <span> important for spacing --> <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> - application/json + rosalee.schultz@example.org </div> </div> </div> </div> </div> - <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + + </div> + <div class="expandable sl-text-sm sl-border-l sl-ml-px"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> <div class="sl-flex sl-items-center sl-max-w-full"> <div class="sl-flex sl-items-baseline sl-text-base"> - <div class="sl-font-mono sl-font-semibold sl-mr-2">Accept</div> + <div class="sl-font-mono sl-font-semibold sl-mr-2">current_team_id</div> + <span class="sl-truncate sl-text-muted">integer</span> </div> </div> <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> <span>Example:</span> <!-- <span> important for spacing --> <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> - application/json + 6 </div> </div> </div> </div> </div> - </div> - </div> - - - + </div> + </div> + </div> </div> </div> @@ -3526,10 +16668,17 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <div class="sl-px-0 sl-py-1"> <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> <pre><code class="language-bash">curl --request POST \ - "https://vine.openfoodnetwork.org.au/api/v1/my-team-audit-items" \ + "https://vine.openfoodnetwork.org.au/api/v1/admin/users" \ --header "Authorization: Bearer {YOUR_API_TOKEN}" \ --header "Content-Type: application/json" \ - --header "Accept: application/json"</code></pre> </div> + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..." \ + --data "{ + \"name\": \"voluptatem\", + \"email\": \"rosalee.schultz@example.org\", + \"current_team_id\": 6 +}" +</code></pre> </div> </div> </div> <div class="sl-bg-canvas-100 example-request example-request-javascript" @@ -3537,18 +16686,26 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <div class="sl-px-0 sl-py-1"> <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> <pre><code class="language-javascript">const url = new URL( - "https://vine.openfoodnetwork.org.au/api/v1/my-team-audit-items" + "https://vine.openfoodnetwork.org.au/api/v1/admin/users" ); const headers = { "Authorization": "Bearer {YOUR_API_TOKEN}", "Content-Type": "application/json", "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", +}; + +let body = { + "name": "voluptatem", + "email": "rosalee.schultz@example.org", + "current_team_id": 6 }; fetch(url, { method: "POST", headers, + body: JSON.stringify(body), }).then(response => response.json());</code></pre> </div> </div> </div> @@ -3557,7 +16714,7 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <div class="sl-px-0 sl-py-1"> <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> <pre><code class="language-php">$client = new \GuzzleHttp\Client(); -$url = 'https://vine.openfoodnetwork.org.au/api/v1/my-team-audit-items'; +$url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/users'; $response = $client->post( $url, [ @@ -3565,6 +16722,12 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw 'Authorization' => 'Bearer {YOUR_API_TOKEN}', 'Content-Type' => 'application/json', 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', + ], + 'json' => [ + 'name' => 'voluptatem', + 'email' => 'rosalee.schultz@example.org', + 'current_team_id' => 6, ], ] ); @@ -3579,14 +16742,20 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <pre><code class="language-python">import requests import json -url = 'https://vine.openfoodnetwork.org.au/api/v1/my-team-audit-items' +url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/users' +payload = { + "name": "voluptatem", + "email": "rosalee.schultz@example.org", + "current_team_id": 6 +} headers = { 'Authorization': 'Bearer {YOUR_API_TOKEN}', 'Content-Type': 'application/json', - 'Accept': 'application/json' + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' } -response = requests.request('POST', url, headers=headers) +response = requests.request('POST', url, headers=headers, json=payload) response.json()</code></pre> </div> </div> </div> @@ -3601,14 +16770,14 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <div class="sl-relative"> <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" - id="endpoints-GETapi-v1-my-team-audit-items"> - GET / + id="endpoints-GETapi-v1-admin-users--id-"> + GET / {id} </h2> </div> </div> <div class="sl-relative"> - <div title="https://vine.openfoodnetwork.org.au/api/v1/my-team-audit-items" + <div title="https://vine.openfoodnetwork.org.au/api/v1/admin/users/{id}" class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" > <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" @@ -3619,7 +16788,7 @@ class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-i <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> <div dir="rtl" class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> - <div class="sl-flex-1 sl-font-semibold">/api/v1/my-team-audit-items</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/admin/users/{id}</div> </div> <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" @@ -3693,10 +16862,58 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw </div> </div> </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + JWT eyJ0eXAiOiJKV... + </div> + </div> + </div> + </div> </div> </div> </div> + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">URL Parameters</h3> + + <div class="sl-text-sm"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">id</div> + <span class="sl-truncate sl-text-muted">string</span> + </div> + <div class="sl-flex-1 sl-h-px sl-mx-3"></div> + <span class="sl-ml-2 sl-text-warning">required</span> + </div> + <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> + <p>The ID of the user.</p> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + cumque + </div> + </div> + </div> + </div> +</div> + </div> + </div> @@ -3730,10 +16947,11 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <div class="sl-px-0 sl-py-1"> <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> <pre><code class="language-bash">curl --request GET \ - --get "https://vine.openfoodnetwork.org.au/api/v1/my-team-audit-items" \ + --get "https://vine.openfoodnetwork.org.au/api/v1/admin/users/cumque" \ --header "Authorization: Bearer {YOUR_API_TOKEN}" \ --header "Content-Type: application/json" \ - --header "Accept: application/json"</code></pre> </div> + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..."</code></pre> </div> </div> </div> <div class="sl-bg-canvas-100 example-request example-request-javascript" @@ -3741,13 +16959,14 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <div class="sl-px-0 sl-py-1"> <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> <pre><code class="language-javascript">const url = new URL( - "https://vine.openfoodnetwork.org.au/api/v1/my-team-audit-items" + "https://vine.openfoodnetwork.org.au/api/v1/admin/users/cumque" ); const headers = { "Authorization": "Bearer {YOUR_API_TOKEN}", "Content-Type": "application/json", "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", }; fetch(url, { @@ -3761,7 +16980,7 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <div class="sl-px-0 sl-py-1"> <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> <pre><code class="language-php">$client = new \GuzzleHttp\Client(); -$url = 'https://vine.openfoodnetwork.org.au/api/v1/my-team-audit-items'; +$url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/users/cumque'; $response = $client->get( $url, [ @@ -3769,6 +16988,7 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw 'Authorization' => 'Bearer {YOUR_API_TOKEN}', 'Content-Type' => 'application/json', 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', ], ] ); @@ -3783,11 +17003,12 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <pre><code class="language-python">import requests import json -url = 'https://vine.openfoodnetwork.org.au/api/v1/my-team-audit-items' +url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/users/cumque' headers = { 'Authorization': 'Bearer {YOUR_API_TOKEN}', 'Content-Type': 'application/json', - 'Accept': 'application/json' + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' } response = requests.request('GET', url, headers=headers) @@ -3804,9 +17025,9 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <div class="sl-mb-2 sl-inline-block">Example response:</div> <div class="sl-mb-2 sl-inline-block"> <select - class="example-response-GETapi-v1-my-team-audit-items-toggle sl-text-base" + class="example-response-GETapi-v1-admin-users--id--toggle sl-text-base" aria-label="Response sample" - onchange="switchExampleResponse('GETapi-v1-my-team-audit-items', event.target.value);"> + onchange="switchExampleResponse('GETapi-v1-admin-users--id-', event.target.value);"> <option value="0">401</option> </select></div> </div> @@ -3824,7 +17045,7 @@ class="svg-inline--fa fa-copy fa-fw fa-sm sl-icon" role="img" </div> </button> </div> - <div class="sl-panel__content-wrapper sl-bg-canvas-100 example-response-GETapi-v1-my-team-audit-items example-response-GETapi-v1-my-team-audit-items-0" + <div class="sl-panel__content-wrapper sl-bg-canvas-100 example-response-GETapi-v1-admin-users--id- example-response-GETapi-v1-admin-users--id--0" style=" " > <div class="sl-panel__content sl-p-0"> <details class="sl-pl-2"> @@ -3868,25 +17089,30 @@ class="language-json sl-overflow-x-auto sl-overflow-y-auto">{ <div class="sl-relative"> <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" - id="endpoints-GETapi-v1-my-team-audit-items--id-"> - GET /{id} + id="endpoints-PUTapi-v1-admin-users--id-"> + PUT/ {id} </h2> </div> </div> <div class="sl-relative"> - <div title="https://vine.openfoodnetwork.org.au/api/v1/my-team-audit-items/{id}" + <div title="https://vine.openfoodnetwork.org.au/api/v1/admin/users/{id}" class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" > <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" - style="background-color: green;" + style="background-color: darkblue;" > - GET + PUT + </div> + <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" + style="background-color: purple;" + > + PATCH </div> <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> <div dir="rtl" class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> - <div class="sl-flex-1 sl-font-semibold">/api/v1/my-team-audit-items/{id}</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/admin/users/{id}</div> </div> <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" @@ -3960,6 +17186,24 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw </div> </div> </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + JWT eyJ0eXAiOiJKV... + </div> + </div> + </div> + </div> </div> </div> </div> @@ -3980,13 +17224,13 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <span class="sl-ml-2 sl-text-warning">required</span> </div> <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> - <p>The ID of the my team audit item.</p> + <p>The ID of the user.</p> </div> <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> <span>Example:</span> <!-- <span> important for spacing --> <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> - tempora + et </div> </div> </div> @@ -3997,6 +17241,34 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw + <div class="sl-stack sl-stack--vertical sl-stack--6 sl-flex sl-flex-col sl-items-stretch"> + <h3 class="sl-text-2xl sl-leading-snug sl-font-prose">Body Parameters</h3> + + <div class="sl-text-sm"> + <div class="expandable sl-text-sm sl-border-l sl-ml-px"> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">is_admin</div> + <span class="sl-truncate sl-text-muted">boolean</span> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + 1 + </div> + </div> + </div> + </div> +</div> + + </div> + </div> + </div> </div> </div> @@ -4026,11 +17298,16 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw style=""> <div class="sl-px-0 sl-py-1"> <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> - <pre><code class="language-bash">curl --request GET \ - --get "https://vine.openfoodnetwork.org.au/api/v1/my-team-audit-items/tempora" \ + <pre><code class="language-bash">curl --request PUT \ + "https://vine.openfoodnetwork.org.au/api/v1/admin/users/et" \ --header "Authorization: Bearer {YOUR_API_TOKEN}" \ --header "Content-Type: application/json" \ - --header "Accept: application/json"</code></pre> </div> + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..." \ + --data "{ + \"is_admin\": true +}" +</code></pre> </div> </div> </div> <div class="sl-bg-canvas-100 example-request example-request-javascript" @@ -4038,18 +17315,24 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <div class="sl-px-0 sl-py-1"> <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> <pre><code class="language-javascript">const url = new URL( - "https://vine.openfoodnetwork.org.au/api/v1/my-team-audit-items/tempora" + "https://vine.openfoodnetwork.org.au/api/v1/admin/users/et" ); const headers = { "Authorization": "Bearer {YOUR_API_TOKEN}", "Content-Type": "application/json", "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", +}; + +let body = { + "is_admin": true }; fetch(url, { - method: "GET", + method: "PUT", headers, + body: JSON.stringify(body), }).then(response => response.json());</code></pre> </div> </div> </div> @@ -4058,14 +17341,18 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <div class="sl-px-0 sl-py-1"> <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> <pre><code class="language-php">$client = new \GuzzleHttp\Client(); -$url = 'https://vine.openfoodnetwork.org.au/api/v1/my-team-audit-items/tempora'; -$response = $client->get( +$url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/users/et'; +$response = $client->put( $url, [ 'headers' => [ 'Authorization' => 'Bearer {YOUR_API_TOKEN}', 'Content-Type' => 'application/json', 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', + ], + 'json' => [ + 'is_admin' => true, ], ] ); @@ -4080,82 +17367,23 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <pre><code class="language-python">import requests import json -url = 'https://vine.openfoodnetwork.org.au/api/v1/my-team-audit-items/tempora' +url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/users/et' +payload = { + "is_admin": true +} headers = { 'Authorization': 'Bearer {YOUR_API_TOKEN}', 'Content-Type': 'application/json', - 'Accept': 'application/json' + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' } -response = requests.request('GET', url, headers=headers) +response = requests.request('PUT', url, headers=headers, json=payload) response.json()</code></pre> </div> </div> </div> </div> - <div class="sl-panel sl-outline-none sl-w-full sl-rounded-lg"> - <div class="sl-panel__titlebar sl-flex sl-items-center sl-relative focus:sl-z-10 sl-text-base sl-leading-none sl-pr-3 sl-pl-4 sl-bg-canvas-200 sl-text-body sl-border-input focus:sl-border-primary sl-select-none"> - <div class="sl-flex sl-flex-1 sl-items-center sl-py-2"> - <div class="sl--ml-2"> - <div class="sl-h-sm sl-text-base sl-font-medium sl-px-1.5 sl-text-muted sl-rounded sl-border-transparent sl-border"> - <div class="sl-mb-2 sl-inline-block">Example response:</div> - <div class="sl-mb-2 sl-inline-block"> - <select - class="example-response-GETapi-v1-my-team-audit-items--id--toggle sl-text-base" - aria-label="Response sample" - onchange="switchExampleResponse('GETapi-v1-my-team-audit-items--id-', event.target.value);"> - <option value="0">401</option> - </select></div> - </div> - </div> - </div> - <button type="button" - class="sl-button sl-h-sm sl-text-base sl-font-medium sl-px-1.5 hover:sl-bg-canvas-50 active:sl-bg-canvas-100 sl-text-muted hover:sl-text-body focus:sl-text-body sl-rounded sl-border-transparent sl-border disabled:sl-opacity-70"> - <div class="sl-mx-0"> - <svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="copy" - class="svg-inline--fa fa-copy fa-fw fa-sm sl-icon" role="img" - xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"> - <path fill="currentColor" - d="M384 96L384 0h-112c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48H464c26.51 0 48-21.49 48-48V128h-95.1C398.4 128 384 113.6 384 96zM416 0v96h96L416 0zM192 352V128h-144c-26.51 0-48 21.49-48 48v288c0 26.51 21.49 48 48 48h192c26.51 0 48-21.49 48-48L288 416h-32C220.7 416 192 387.3 192 352z"></path> - </svg> - </div> - </button> - </div> - <div class="sl-panel__content-wrapper sl-bg-canvas-100 example-response-GETapi-v1-my-team-audit-items--id- example-response-GETapi-v1-my-team-audit-items--id--0" - style=" " - > - <div class="sl-panel__content sl-p-0"> <details class="sl-pl-2"> - <summary style="cursor: pointer; list-style: none;"> - <small> - <span class="expansion-chevrons"> - - <svg aria-hidden="true" focusable="false" data-prefix="fas" - data-icon="chevron-right" - class="svg-inline--fa fa-chevron-right fa-fw sl-icon sl-text-muted" - xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"> - <path fill="currentColor" - d="M96 480c-8.188 0-16.38-3.125-22.62-9.375c-12.5-12.5-12.5-32.75 0-45.25L242.8 256L73.38 86.63c-12.5-12.5-12.5-32.75 0-45.25s32.75-12.5 45.25 0l192 192c12.5 12.5 12.5 32.75 0 45.25l-192 192C112.4 476.9 104.2 480 96 480z"></path> - </svg> - </span> - Headers - </small> - </summary> - <pre><code class="language-http"> cache-control - : no-cache, private - content-type - : application/json - access-control-allow-origin - : * - </code></pre> - </details> - - <pre><code style="max-height: 300px;" - class="language-json sl-overflow-x-auto sl-overflow-y-auto">{ - "message": "Unauthenticated." -}</code></pre> - </div> - </div> - </div> </div> </div> </div> @@ -4165,14 +17393,14 @@ class="language-json sl-overflow-x-auto sl-overflow-y-auto">{ <div class="sl-relative"> <div class="sl-stack sl-stack--horizontal sl-stack--5 sl-flex sl-flex-row sl-items-center"> <h2 class="sl-text-3xl sl-leading-tight sl-font-prose sl-text-heading sl-mt-5 sl-mb-1" - id="endpoints-DELETEapi-v1-my-team-audit-items--id-"> + id="endpoints-DELETEapi-v1-admin-users--id-"> DELETE / {id} </h2> </div> </div> <div class="sl-relative"> - <div title="https://vine.openfoodnetwork.org.au/api/v1/my-team-audit-items/{id}" + <div title="https://vine.openfoodnetwork.org.au/api/v1/admin/users/{id}" class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-items-center sl-max-w-full sl-font-mono sl-py-2 sl-pr-4 sl-bg-canvas-50 sl-rounded-lg" > <div class="sl-text-lg sl-font-semibold sl-px-2.5 sl-py-1 sl-text-on-primary sl-rounded-lg" @@ -4183,7 +17411,7 @@ class="sl-stack sl-stack--horizontal sl-stack--3 sl-inline-flex sl-flex-row sl-i <div class="sl-flex sl-overflow-x-hidden sl-text-lg sl-select-all"> <div dir="rtl" class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetwork.org.au</div> - <div class="sl-flex-1 sl-font-semibold">/api/v1/my-team-audit-items/{id}</div> + <div class="sl-flex-1 sl-font-semibold">/api/v1/admin/users/{id}</div> </div> <div class="sl-font-prose sl-font-semibold sl-px-1.5 sl-py-0.5 sl-text-on-primary sl-rounded-lg" @@ -4257,6 +17485,24 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw </div> </div> </div> +</div> + <div class="sl-flex sl-relative sl-max-w-full sl-py-2 sl-pl-3"> + <div class="sl-w-1 sl-mt-2 sl-mr-3 sl--ml-3 sl-border-t"></div> + <div class="sl-stack sl-stack--vertical sl-stack--1 sl-flex sl-flex-1 sl-flex-col sl-items-stretch sl-max-w-full sl-ml-2 "> + <div class="sl-flex sl-items-center sl-max-w-full"> + <div class="sl-flex sl-items-baseline sl-text-base"> + <div class="sl-font-mono sl-font-semibold sl-mr-2">X-Authorisation</div> + </div> + </div> + <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> + <span>Example:</span> <!-- <span> important for spacing --> + <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> + <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> + JWT eyJ0eXAiOiJKV... + </div> + </div> + </div> + </div> </div> </div> </div> @@ -4277,13 +17523,13 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <span class="sl-ml-2 sl-text-warning">required</span> </div> <div class="sl-prose sl-markdown-viewer" style="font-size: 12px;"> - <p>The ID of the my team audit item.</p> + <p>The ID of the user.</p> </div> <div class="sl-stack sl-stack--horizontal sl-stack--2 sl-flex sl-flex-row sl-items-baseline sl-text-muted"> <span>Example:</span> <!-- <span> important for spacing --> <div class="sl-flex sl-flex-1 sl-flex-wrap" style="gap: 4px;"> <div class="sl-max-w-full sl-break-all sl-px-1 sl-bg-canvas-tint sl-text-muted sl-rounded sl-border"> - quidem + fuga </div> </div> </div> @@ -4324,10 +17570,11 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <div class="sl-px-0 sl-py-1"> <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> <pre><code class="language-bash">curl --request DELETE \ - "https://vine.openfoodnetwork.org.au/api/v1/my-team-audit-items/quidem" \ + "https://vine.openfoodnetwork.org.au/api/v1/admin/users/fuga" \ --header "Authorization: Bearer {YOUR_API_TOKEN}" \ --header "Content-Type: application/json" \ - --header "Accept: application/json"</code></pre> </div> + --header "Accept: application/json" \ + --header "X-Authorisation: JWT eyJ0eXAiOiJKV..."</code></pre> </div> </div> </div> <div class="sl-bg-canvas-100 example-request example-request-javascript" @@ -4335,13 +17582,14 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <div class="sl-px-0 sl-py-1"> <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> <pre><code class="language-javascript">const url = new URL( - "https://vine.openfoodnetwork.org.au/api/v1/my-team-audit-items/quidem" + "https://vine.openfoodnetwork.org.au/api/v1/admin/users/fuga" ); const headers = { "Authorization": "Bearer {YOUR_API_TOKEN}", "Content-Type": "application/json", "Accept": "application/json", + "X-Authorisation": "JWT eyJ0eXAiOiJKV...", }; fetch(url, { @@ -4355,7 +17603,7 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <div class="sl-px-0 sl-py-1"> <div style="max-height: 400px;" class="sl-overflow-y-auto sl-rounded"> <pre><code class="language-php">$client = new \GuzzleHttp\Client(); -$url = 'https://vine.openfoodnetwork.org.au/api/v1/my-team-audit-items/quidem'; +$url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/users/fuga'; $response = $client->delete( $url, [ @@ -4363,6 +17611,7 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw 'Authorization' => 'Bearer {YOUR_API_TOKEN}', 'Content-Type' => 'application/json', 'Accept' => 'application/json', + 'X-Authorisation' => 'JWT eyJ0eXAiOiJKV...', ], ] ); @@ -4377,11 +17626,12 @@ class="sl-overflow-x-hidden sl-truncate sl-text-muted">https://vine.openfoodnetw <pre><code class="language-python">import requests import json -url = 'https://vine.openfoodnetwork.org.au/api/v1/my-team-audit-items/quidem' +url = 'https://vine.openfoodnetwork.org.au/api/v1/admin/users/fuga' headers = { 'Authorization': 'Bearer {YOUR_API_TOKEN}', 'Content-Type': 'application/json', - 'Accept': 'application/json' + 'Accept': 'application/json', + 'X-Authorisation': 'JWT eyJ0eXAiOiJKV...' } response = requests.request('DELETE', url, headers=headers) diff --git a/routes/api.php b/routes/api.php index f8fca1b..a3b7026 100644 --- a/routes/api.php +++ b/routes/api.php @@ -17,9 +17,10 @@ use App\Http\Controllers\Api\V1\ApiShopsController; use App\Http\Controllers\Api\V1\ApiSystemStatisticsController; use App\Http\Middleware\CheckAdminStatus; +use App\Http\Middleware\VerifyApiTokenSignature; use Illuminate\Support\Facades\Route; -Route::group(['prefix' => 'v1'], function () { +Route::group(['prefix' => 'v1', 'middleware' => VerifyApiTokenSignature::class], function () { /** * App API Routes @@ -27,7 +28,20 @@ Route::middleware(['auth:sanctum']) ->group(function () { - Route::resource('/my-team', ApiMyTeamController::class)->names('api.v1.my-team'); +// Route::resource('/my-team', ApiMyTeamController::class)->names('api.v1.my-team'); + + /** + * My Team + */ + Route::get('/my-team', [ApiMyTeamController::class, 'index']) + ->name('api.v1.my-team.get') + ->middleware( + [ + 'abilities:' . + PersonalAccessTokenAbility::SUPER_ADMIN->value . ',' . + PersonalAccessTokenAbility::MY_TEAM_READ->value, + ] + ); /** * My Audit Items diff --git a/tests/Feature/API/BaseAPITestCase.php b/tests/Feature/API/BaseAPITestCase.php index f3534b0..8825776 100644 --- a/tests/Feature/API/BaseAPITestCase.php +++ b/tests/Feature/API/BaseAPITestCase.php @@ -14,10 +14,25 @@ class BaseAPITestCase extends TestCase { use DatabaseTransactions; - public string $apiRoot = '/api/v1'; - public User|Model $user; + public string $apiRoot = '/api/v1'; + public User|Model $user; public TeamUser|Model $teamUser; - public Team|Model $team; + public Team|Model $team; + + protected function setUp(): void + { + parent::setUp(); + + /** + * Set default referer for all requests. This is necessary, or else + * we'd need to JWT-sign all requests, which would be a nightmare + */ + $this->withHeaders( + [ + 'Referer' => env('APP_URL'), + ] + ); + } public function createUser(): Collection|Model|User { @@ -29,8 +44,8 @@ public function createUser(): Collection|Model|User public function createAdminUser(): Collection|Model|User { $this->user = User::factory()->create([ - 'is_admin' => 1, - ]); + 'is_admin' => 1, + ]); return $this->user; } @@ -38,18 +53,18 @@ public function createAdminUser(): Collection|Model|User public function createUserWithTeam(): Model|Collection|User { $this->team = Team::factory() - ->create(); + ->create(); $this->user = User::factory() - ->create([ - 'current_team_id' => $this->team->id, - 'is_admin' => 0, - ]); + ->create([ + 'current_team_id' => $this->team->id, + 'is_admin' => 0, + ]); $this->teamUser = TeamUser::factory()->createQuietly([ - 'team_id' => $this->team->id, - 'user_id' => $this->user->id, - ]); + 'team_id' => $this->team->id, + 'user_id' => $this->user->id, + ]); return $this->user; } diff --git a/tests/Feature/API/ExternalRequestsMustBeSignedTest.php b/tests/Feature/API/ExternalRequestsMustBeSignedTest.php new file mode 100644 index 0000000..ef407f7 --- /dev/null +++ b/tests/Feature/API/ExternalRequestsMustBeSignedTest.php @@ -0,0 +1,84 @@ +<?php + +namespace Tests\Feature\API; + + +use App\Enums\ApiResponse; +use App\Enums\PersonalAccessTokenAbility; +use App\Models\PersonalAccessToken; +use App\Services\PersonalAccessTokenService; +use Laravel\Sanctum\Sanctum; +use PHPUnit\Framework\Attributes\Test; + +class ExternalRequestsMustBeSignedTest extends BaseAPITestCase +{ + #[Test] + public function externalApiRequestsFailIfNotSigned(): void + { + /** + * Remove the Referer header to indicate a request from an external source + */ + $this->withoutHeader('Referer'); + + $this->user = $this->createUser(); + + Sanctum::actingAs($this->user, abilities: [ + PersonalAccessTokenAbility::SYSTEM_STATISTICS_READ->value, + ]); + + $response = $this->getJson($this->apiRoot . '/system-statistics'); + + $responseObject = $response->json(); + + $this->assertEquals( + ApiResponse::RESPONSE_AUTHORIZATION_SIGNATURE_INCORRECT->value . ' ' . ApiResponse::RESPONSE_AUTHORIZATION_SIGNATURE_INCORRECT_JWT_HEADER_REQUIRED->value, + $responseObject['meta']['message'] + ); + $response->assertStatus(401); + } + + #[Test] + public function externalApiRequestsPassIfSigned(): void + { + /** + * Remove the Referer header to indicate a request from an external source + */ + $this->withoutHeader('Referer'); + + /** + * Create a user + */ + $this->user = $this->createUser(); + + /** + * Give them an access token + */ + $newAccessToken = $this->user->createToken('PJGToken', abilities: [ + PersonalAccessTokenAbility::SYSTEM_STATISTICS_READ->value, + ]); + + /** + * Generate the JWT + */ + $jwt = PersonalAccessTokenService::generateJwtForPersonalAccessToken($newAccessToken->accessToken); + + + /** + * Pass it in as X-Authorization + */ + $this->withHeader('X-Authorization', 'JWT ' . $jwt); + + /** + * Pass in the API token as usual + */ + $this->withHeader('Authorization', 'Bearer ' . $newAccessToken->plainTextToken); + + /** + * Make the call + */ + $response = $this->getJson($this->apiRoot . '/system-statistics'); + + $response->assertStatus(200); + } + +}