AgriWebb API
API Reference

Authorisation Request

GET
/oauth2/authorize

Begin an OAuth 2.0 Authorization Code Grant flow against the AgriWebb API. Redirect the user's browser here. Once they approve or deny the request, AgriWebb redirects them to your Callback Endpoint.

Errors

An invalid request never reaches your Callback Endpoint. AgriWebb redirects the user to an AgriWebb error page instead, with error and error_description in its query string. error is one of:

  • invalid_request: a parameter is missing or invalid, including a redirect_uri that is not registered for the client.
  • unauthorized_client: the client_id is unknown.
  • invalid_scope: a requested scope is unknown, or not allowed for the client.
  • server_error: AgriWebb could not process the request.

Query Parameters

client_id*string

The Client ID issued to the partner at registration.

Lengthlength <= 64
response_type*"code"

The OAuth 2.0 response type.

Value in"code"
organization?string

The organisation ID received by the Install Endpoint.

Lengthlength <= 64
state?string

An opaque value set by the partner. It is returned unchanged as the state parameter of the Callback Endpoint.

Lengthlength <= 2048
scope?string

The requested scopes, separated by spaces, from the list on Authentication.

Lengthlength <= 2048
redirect_uri?string

The Redirect URL the user is sent back to. It must match a Redirect URL registered for the client, and is required when more than one is registered.

Formaturi
Lengthlength <= 2048

Response Body

Redirects the user to AgriWebb to sign in and approve the request, or to an AgriWebb error page if the request is invalid.

curl -X GET "https://example.com/oauth2/authorize?client_id=string&response_type=code"
Empty