API Explorer

Scenario 4: Grant account access to another User

		|### 1) Create account
		|
		|Create an account as described in Step 5 of section [Onboarding a user](#Onboarding-a-user)
		|
		|### 2) Create a view (private)
		|
		|Action:
		|
		|	POST https://obp-api-sandbox.nmbbank.co.tz/obp/v4.0.0/banks/BANK_ID/accounts/your-account-id-from-step-1/views
		|
		|Body:
		|
		|	{  "name":"_test", "description":"good", "is_public":false, "which_alias_to_use":"accountant", "hide_metadata_if_alias_used":false,  "allowed_actions": [can_see_transaction_this_bank_account,can_see_transaction_other_bank_account,can_see_transaction_metadata,,can_see_transaction_amount,can_see_transaction_type,can_see_transaction_currency,can_see_transaction_start_date,can_see_transaction_finish_date,can_see_transaction_balance,can_see_comments,can_see_tags,can_see_images,can_see_bank_account_owners,can_see_bank_account_type,can_see_bank_account_balance,can_see_bank_account_currency,can_see_bank_account_label,can_see_bank_account_national_identifier,can_see_bank_account_swift_bic,can_see_bank_account_iban,can_see_bank_account_number,can_see_bank_account_bank_name,can_see_other_account_national_identifier,can_see_other_account_swift_bic,can_see_other_account_iban,can_see_other_account_bank_name,can_see_other_account_number,can_see_other_account_metadata,can_see_other_account_kind,can_see_more_info,can_see_url,can_see_image_url,can_see_open_corporates_url,can_see_corporate_location,can_see_physical_location,can_see_public_alias,can_see_private_alias,can_add_more_info,can_add_url,can_add_image_url,can_add_open_corporates_url,can_add_corporate_location,can_add_physical_location,can_add_public_alias,can_add_private_alias,can_delete_corporate_location,can_delete_physical_location,can_add_comment,can_delete_comment,can_add_tag,can_delete_tag,can_add_image,can_delete_image,can_add_where_tag,can_see_where_tag,can_delete_where_tag,can_see_bank_routing_scheme,can_see_bank_routing_address,can_see_bank_account_routing_scheme,can_see_bank_account_routing_address,can_see_other_bank_routing_scheme,can_see_other_bank_routing_address,can_see_other_account_routing_scheme,can_see_other_account_routing_address,can_query_available_funds,can_add_transaction_request_to_own_account,can_add_transaction_request_to_any_account,can_see_bank_account_credit_limit,can_create_direct_debit,can_create_standing_order]}
		|
		| Headers:
		|
		|	Content-Type:  application/json
		|
		|	DirectLogin: token="your-token"
		|
		|### 3) Get User (Current)
		|
		|Action:
		|
		|	GET https://obp-api-sandbox.nmbbank.co.tz/obp/v4.0.0/users/current
		|
		|
		| Headers:
		|
		|	Content-Type:  application/json
		|
		|	DirectLogin: token="your-token"
		|
		|### 4) Grant user access to himself
		|
		|Action:
		|
		|	POST https://obp-api-sandbox.nmbbank.co.tz/obp/v4.0.0/banks/BANK_ID/accounts/your-account-id-from-step-1/account-access/grant
		|
		|Body:
		|
		|	{  "user_id":"your-user-id-from-step3",  "view":{    "view_id":"_test",    "is_system":false  }}
		|
		| Headers:
		|
		|	Content-Type:  application/json
		|
		|	DirectLogin: token="your-token"
		|
		|### 5) Grant user access to view to another user
		|
		|Action:
		|
		|	POST https://obp-api-sandbox.nmbbank.co.tz/obp/v4.0.0/banks/BANK_ID/accounts/your-account-id-from-step-1/account-access/grant
		|
		|Body:
		|
		|	{  "user_id":"another-user-id",  "view":{    "view_id":"_test",    "is_system":false  }}
		|
		| Headers:
		|
		|	Content-Type:  application/json
		|
		|	DirectLogin: token="your-token"
		|
		|