Procore.Api.AuthenticationOAuth20Authentication (procore_sdk v0.3.0)

API calls for all endpoints tagged AuthenticationOAuth20Authentication.

Summary

Functions

Grant App Authorization Creates and returns a temporary authorization code with 10 minute expiration. Note that all parameters listed below are required. This endpoint corresponds to the OAuth 2.0 authorization endpoint described in section 3.1 of the OAuth 2.0 RFC. See the Authentication Guide for additional information and authentication examples.

Revoke Token Revoke authorization of an access token. The request must contain the body data as form-data. The authorization server responds with HTTP status code 200 if the token has been revoked successfully or if the client submitted an invalid token. Note that the Revoke Token endpoint revokes both the Access Token and Refresh Token. The client_secret param is only required for confidential applications. Public applications using the implicit OAuth flow do not need to provide this parameter to revoke access tokens.

Get Token Info Return access token details. See the Authentication Guide for additional information and authentication examples. The request must contain the access token in the Authorization header: Authorization: Bearer <YOUR_ACCESS_TOKEN>

Get or Refresh an Access Token Used to acquire a new access token or refresh an existing access token. Certain parameter combinations and values are used depending on which scenario you are handling. See the individual parameter descriptions for additional information. This endpoint corresponds to the token endpoint described in section 3.2 of the OAuth 2.0 RFC. See the Authentication Guide for additional information and authentication examples. JavaScript applications cannot make this request to get the access token or refresh token.

Functions

Link to this function

oauth_authorize_get(connection, response_type, client_id, redirect_uri, opts \\ [])

@spec oauth_authorize_get(
  Tesla.Env.client(),
  String.t(),
  String.t(),
  String.t(),
  keyword()
) ::
  {:ok, nil}
  | {:ok,
     Procore.Model.RestV10CompaniesCompanyIdWorkflowPermanentLogsGet401Response.t()}
  | {:error, Tesla.Env.t()}

Grant App Authorization Creates and returns a temporary authorization code with 10 minute expiration. Note that all parameters listed below are required. This endpoint corresponds to the OAuth 2.0 authorization endpoint described in section 3.1 of the OAuth 2.0 RFC. See the Authentication Guide for additional information and authentication examples.

Parameters

  • connection (Procore.Connection): Connection to server
  • response_type (String.t): Response type. Value should be code for server apps, token for client apps.
  • client_id (String.t): Client ID you were assigned when you registered your application.
  • redirect_uri (String.t): The URI that the user will be redirected to after they grant authorization to your application. For browser-based web applications, use a https:// web address. For "headless" applications use urn:ietf:wg:oauth:2.0:oob.
  • opts (keyword): Optional parameters

Returns

  • {:ok, Procore.Model.RestV10CompaniesCompanyIdWorkflowPermanentLogsGet401Response.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

oauth_revoke_post(connection, procore_company_id, oauth_revoke_post_request, opts \\ [])

Revoke Token Revoke authorization of an access token. The request must contain the body data as form-data. The authorization server responds with HTTP status code 200 if the token has been revoked successfully or if the client submitted an invalid token. Note that the Revoke Token endpoint revokes both the Access Token and Refresh Token. The client_secret param is only required for confidential applications. Public applications using the implicit OAuth flow do not need to provide this parameter to revoke access tokens.

Parameters

  • connection (Procore.Connection): Connection to server
  • procore_company_id (integer()): Unique company identifier associated with the Procore User Account.
  • oauth_revoke_post_request (OauthRevokePostRequest):
  • opts (keyword): Optional parameters

Returns

  • {:ok, map()} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

oauth_token_info_get(connection, opts \\ [])

Get Token Info Return access token details. See the Authentication Guide for additional information and authentication examples. The request must contain the access token in the Authorization header: Authorization: Bearer <YOUR_ACCESS_TOKEN>

Parameters

  • connection (Procore.Connection): Connection to server
  • opts (keyword): Optional parameters

Returns

  • {:ok, Procore.Model.OauthTokenInfoGet200Response.t} on success
  • {:error, Tesla.Env.t} on failure
Link to this function

oauth_token_post(connection, oauth_token_post_request, opts \\ [])

Get or Refresh an Access Token Used to acquire a new access token or refresh an existing access token. Certain parameter combinations and values are used depending on which scenario you are handling. See the individual parameter descriptions for additional information. This endpoint corresponds to the token endpoint described in section 3.2 of the OAuth 2.0 RFC. See the Authentication Guide for additional information and authentication examples. JavaScript applications cannot make this request to get the access token or refresh token.

Parameters

  • connection (Procore.Connection): Connection to server
  • oauth_token_post_request (OauthTokenPostRequest):
  • opts (keyword): Optional parameters

Returns

  • {:ok, Procore.Model.OauthTokenPost200Response.t} on success
  • {:error, Tesla.Env.t} on failure